Last answered:

11 Apr 2024

Posted on:

09 Apr 2024

0

How can I add an AUTO_INCREMENT to an already existing table?

Have tried altring the table and adding auto_increment(customer_id) but giving error.  

1 answers ( 0 marked as helpful)
Instructor
Posted on:

11 Apr 2024

0

Hi Namnso!

Thanks for reaching out!

Can you please provide a screenshot of the error you're encountering? 

Please note that to add an AUTO_INCREMENT attribute to a column, the column must be defined as a key. So, if that's not specified, you'll get an error.

Best,

Ivan

Submit an answer