INSERT INTO Clause

The INSERT INTO statement is used to add new records to a table. Data can be added in two ways. The first method requires specifying column names followed by the values we want to add.

Formula:

INSERT INTO Table1 (column1, column2, column3, …)
VALUES (value1, value2, value3, …);

You can also add values without specifying column names. In this case, however, you must remember the order of columns in your set because SQL will add values according to the arrangement of columns in the table.

Formula:

INSERT INTO Table1
VALUES (value1, value2, value3, …);

SQL also allows adding values only to specific columns. If we don’t declare a column in our query, SQL will add information only to the columns we specified, and the undeclared columns in the table will be empty (null).

Formula:

INSERT INTO Tabela1 (column1, column3)
VALUES (‘value1’, ‘value3’);

Interesting article? Share further!

Leave A Comment