in reply to Create a table in Mysql with perl

In your client, ; means execute. In DBI, execute is used to execute statements.

$dbh->do("DROP TABLE IF EXISTS newtable"); $dbh->do(" CREATE TABLE newtable SELECT T.time, T.name, T.last, P.company, P.wife FROM T JOIN P ON T.wife = P.wife AND T.company = P.company ");

(do calls prepare and execute for you.)