TOP CATEGORIES

×

How can create column auto increment in SQL?

D

Dee Lan

In an SQL database, an auto-increment column is a special column in a table that automatically generates a unique value for each new record inserted, typically used for primary keys (such as ID).


Query: How To Create an Auto-Increment Column in SQL

CREATE TABLE student (

id INT AUTO_INCREMENT PRIMARY KEY,

name VARCHAR(100),

address VARCHAR(200)

); //Basically, auto-increment means that when you insert a new row, the number automatically increases by one each time.

0 votes

Your Answer