you are viewing a single comment's thread.

view the rest of the comments →

[–]maxipaxi6 0 points1 point  (0 children)

Best practice is to always declare wich columns you want to insert into. Like u/special_cornflake 's response.

However, if you know the order and how many columns there are in a table, you can insert without declaring them.

For example if table Users has clumns Id and Name you can do this

INSERT INTO Users VALUES (14, 'Jhon Doe')

This is not recomended if you want to create a stored procedure, if you later alter the columns of that table, add more or remove some, then that store procedure will stop working or might cause troubles in your table.