INSERT INTO

Also known as · INSERT

Adds rows to a table. Columns that are nullable, have a DEFAULT or are AUTO_INCREMENT can be left out of the column list, and the server fills them in.

sql
INSERT INTO author (first_name, last_name)
VALUES ('Foo', 'Bar');

When to use

PP 03 Q5 asks which INSERT statements succeed given NOT NULL, DEFAULT and AUTO_INCREMENT columns. PP 05 Q3 asks for an example of an optional column (a nullable one defaults to NULL).

See PP 03.

Appears in