is there a single select statement that will do all three of those: primary key, unique, and auto_increment?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here we create a little table:
Note Null is YES, and
idis not a primary key, nor does it auto_increment.Here is the alter command:
Now Null is NO, and
idis a primary key with auto_increment.Primary keys are always unique.