Example (standard-style syntax). Verify supported keywords in your database.
INSERT INTO users (name, email) VALUES ('Ada', 'ada@example.com');Add rows to a table.
INSERT INTO table_name (column_a, column_b) VALUES (value_a, value_b);Example (standard-style syntax). Verify supported keywords in your database.
INSERT INTO users (name, email) VALUES ('Ada', 'ada@example.com');SQLite-oriented variant; dialect behaviour may differ.
INSERT INTO users (name, email) VALUES ('Ada', 'ada@example.com');| Option / clause | Description |
|---|---|
Column list | Name columns receiving values; omitted columns use defaults or NULL where permitted. |
VALUES | Provide one or more rows of values. |
INSERT ... SELECT | Insert rows returned by a query. |
ON CONFLICT / ON DUPLICATE KEY | Handle key conflicts using dialect-specific upsert syntax. |
RETURNING / OUTPUT | Return inserted values where supported. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.