Data Manipulation (INSERT, UPDATE, DELETE)

Lesson 4 of 20

INSERT adds rows, UPDATE rewrites them, DELETE removes them — three verbs, one golden rule: mind your WHERE.

The big picture

Three verbs that change data

SELECT only reads. INSERT, UPDATE and DELETE actually change the database — and WHERE decides how much they touch.

INSERT

Adds one brand-new row per VALUES list. Nothing is overwritten — the table just grows.

UPDATE ... SET

Rewrites values in rows that already exist. WHERE picks exactly which rows are rewritten.

DELETE FROM

Removes whole rows — not columns, and never the table itself.

The WHERE rule

UPDATE and DELETE without WHERE touch EVERY row. Read twice, run once.