The INSERT command inserts records into a table, either from values provided in the SQL command or from rows returned by a SELECT statement.
If the table does not exist or the schema does not match, the INSERT operation fails.Syntax
INSERT INTO <table_path>.<table_name>
[ ( <column_name> [, <column_name> ...]) ]
| VALUES (value [, value ...]) [, (value [, value ...]) ...]
The name of the table that you want to insert data into.
Specifies the branch of the table that you want to insert data into. When this parameter is omitted, the current branch is used.
The name of the column or columns that you want to insert data into.
- If column names are specified, data is inserted in the given column order, and columns not listed are populated as NULL.
- If column names are not specified, data is inserted in the column order of the table.
The query that you want to use to insert into the current table data from another table.
The value or values that you want to insert, if you specified the names of one or more columns. You can insert one or more sets of values, each set corresponding to a record to insert into the table.
ExampleInserts three records
INSERT INTO myTable VALUES
(21, 'Ruth Asawa', 'American, 1926–2013', 'American', 'Female', 1926, 2013, 'Q7382874', '500077806'),
(38, 'Magdalena Abakanowicz', 'Polish, 1930–2017', 'Polish', 'Female', 1930, 2017, 'Q158080', '500084577'),
(56, 'Luis Alberto Acuña', 'Colombian, 1904–1994', 'Colombian', 'Male', 1904, 1994, null, null)