To generate create table code, you could run a mysqldump on the database, which generates code to create all of the tables in the database (and load all of the data).

You could also execute the single SQL command:

show create table <tablename>;