INSERT

Syntax: 

	
INSERT [ OR conflict-algorithm ] INTO [catalog-name.]table-name [(column-name[, column-name]*)] insert-content

insert-content:
VALUES (value[, value]*) | select-statement          
	

The INSERT statement modifies the specified table by creating a new row with provided values or inserting rows obtained from a select statement, depending on the variant of insert-content used.

If insert-content variant with the VALUES keyword is used, a new single row in the table is created. If no column-list is specified then the number of values must be the same as the number of columns in the table. If a list of column-name-s is specified, then the number of values must match the number of specified columns. Columns of the table that are not listed are filled with the default value, or with NULL if no default value is specified.

Alternatively, the INSERT statement may take its data from a SELECT statement. The number of columns in the result of SELECT must exactly match the number of columns in the table if no column list is specified, or it must match the number of column names in the column list. A new entry is made in the table for every row of the SELECT result. Simple and compound SELECT statements may be used.

The optional conflict-clause allows the specification of an alternative constraint conflict resolution algorithm to use during the execution of the command. See the section titled ON CONFLICT clause for additional information. For compatibility with MySQL, the parser allows the use of the single keyword REPLACE INTO as an alias for INSERT OR REPLACE.