← Back to Glossary

INSERT statement

The INSERT statement is a fundamental SQL command used to add new rows of data into a table.

The INSERT statement is a fundamental SQL command used to add new rows of data into a table. In DuckDB, this statement allows you to populate tables with values, either one row at a time or in bulk. The basic syntax involves specifying the target table and the values to be inserted. For example:

Copy code

INSERT INTO employees (first_name, last_name, hire_date) VALUES ('John', 'Doe', '2023-01-15');

Related terms

FAQS

INSERT adds new rows to a table. In DuckDB you can insert one row, many rows at once, or the results of a query.

Use INSERT INTO table (cols) VALUES (...) for explicit values, or INSERT INTO table SELECT ... to insert from a query result.

A variant that updates an existing row when an insert would cause a conflict (for example on a primary key) instead of failing—useful for upserts.