Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (55.6k points)

Can anyone tell me how to add an auto-increment column in an existing table in SQL?

1 Answer

0 votes
by (119k points)

Here is the syntax to add auto-increment column in the existing table in SQL:

ALTER TABLE Table_Name

AUTO_INCREMENT = starting value;

You can specify the starting value as you want. If you do not specify the starting value will be ‘1’ and will increment by ‘1’ after every record.

I advise enrolling this course on SQL training by Intellipaat to learn SQL.

Related questions

0 votes
1 answer
asked Apr 21, 2020 in SQL by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Jul 26, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...