Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

2 Answers
2

You have to specify a length for your VARCHAR fields and also make your AUTO_INCREMENT field a the primary key. I made up lengths here for you - you should consider the maximum length that you actually want for each field.

Not if you include AUTO_INCREMENT in the CREATE TABLE statement.
–
tblPhilMar 23 '12 at 13:20

2

@Phil: To be precise, an AUTO_INCREMENT column does not need to be the Primary Key (or part of it). It just needs to be indexed, alhtough I can't imagine a use for that (and it's certainly not the case here).
–
ypercubeMar 23 '12 at 13:24