is it necessary to specify an id when inserting a line through an insert? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

is it necessary to specify an id when inserting a line through an insert?

in the examples through the insert, inserted a string together with the ID, if you do not specify the ID, SQL will add them yourself?

28th Nov 2017, 2:31 PM
Никита Бурковский
Никита Бурковский - avatar
1 Answer
0
there is! I found a solution in the next lesson. you can use auto increment. the question is closed. thanks that nobody answered, now it will be easier to find a solution for beginners. CREATE TABLE Users ( id int NOT NULL AUTO_INCREMENT, username varchar(40) NOT NULL, password varchar(10) NOT NULL, PRIMARY KEY(id) );
28th Nov 2017, 3:15 PM
Никита Бурковский
Никита Бурковский - avatar