The INSERT query can be used to insert data into the table.
The basic syntax of the INSERT command is:
INSERT INTO TABLENAME VALUES (value1, value2, value3);
or
INSERT INTO TABLENAME (COLUMN1, COLUMN2, COLUMN3) VALUES (value1, value2, value3);
If you use the first syntax, you don't have to specify the column order, but you have to insert values for all the columns in the order in which the columns are defined in the table.
For example,
INSERT INTO NAME VALUES (5, 'AAA', 'B');
This will insert a new tuple in the table:
ID FIRST LAST
5 AAA B
Using the second syntax, you can change the order of the column variables.
For example,
INSERT INTO NAME(FIRST, LAST, ID) VALUES ('AAA', 'B', 5);
This will insert the same tuple in the table:
ID FIRST LAST
5 AAA B
If you use the second syntax, you can also skip columns which you don't need.
For example,
INSERT INTO NAME(FIRST, ID) VALUES ('AAA', 5);
This will insert the same tuple in the table:
ID FIRST LAST
5 AAA