SyntaxFix
Write A Post
Hire A Developer
Questions
Try
CREATE TABLE foo LIKE bar;
so the keys and indexes are copied over as, well.
Documentation