SQL · Writing data

insert

Adds rows. Always list columns explicitly so schema changes do not break the statement.

Syntax
insert into table (cols) values (…);

Example

Open in the lab

More in this group

delete insert from select insert returning merge truncate update update from upsert

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course