C · Write · intermediate · Week 3 · Chapter 8 of 12
INSERT, UPDATE, DELETE safely
Never UPDATE/DELETE without WHERE. SELECT first to preview rows. Use transactions for multi-step changes.
Path progress61%
Step 1 of 3
INSERT
INSERT INTO users (name, email) VALUES (...). INSERT ... SELECT for bulk copies.
Example
INSERT INTO users (name, email, active)
VALUES ('Test User', 'test@example.com', 1);Do this now
Insert 3 test rows into a sandbox table.
Was this step clear?
Chapter learning outcomes
- INSERT
- UPDATE ... WHERE
- DELETE ... WHERE
- Safety ritual
Clear these before you leave
Side quest
Soft delete
UPDATE active=0 instead of DELETE; query active users only.