INSERT Statement

INSERT adds new rows of data into a table. You name the table and columns, then supply the values for each new row.

SQL

You can insert a single row or many rows at once by listing several sets of values. If you leave out a column, it gets its default value or NULL.

INSERT is part of the data-modifying commands (sometimes called DML), alongside UPDATE and DELETE.

Syntax

INSERT INTO table_name (column1, column2)
VALUES (value1, value2);

Examples

SQL

INSERT INTO users (name, age)
VALUES ('Carol', 28);

Output:

1 row inserted.

Learn it in a lesson

See also

Back to the Dictionary