Writing data
INSERT, UPDATE, and DELETE — the statements that change rows instead of just reading them.
Everything else in these docs is about SELECT. These three statements are
how data gets there in the first place, and how it changes.
INSERT
Add rows — single, multi-row, and INSERT ... SELECT.
UPDATE
Change existing rows — and the WHERE clause that stops it from changing every row.
DELETE
Remove rows — and how it differs from TRUNCATE.
Upsert
Insert or update in one statement — ON CONFLICT, ON DUPLICATE KEY, and MERGE.
Playground note
The examples on these pages run against a scratch copy of a seed table
(CREATE TABLE scratch_x AS SELECT * FROM x), not the real one — so running an
UPDATE or DELETE here never affects the examples on other pages. Feel free to
mutate away.
Want to experiment freely? The playground is the same SQLite engine, no guardrails.Open the playground →
Was this page helpful?