What happens when you run DELETE FROM users; without a WHERE clause?
Options
- Nothing, WHERE is required
- It deletes ALL rows in the table (Correct option)
- It deletes the table structure
- It deletes the first row
Answer
It deletes ALL rows in the table
Why
Without WHERE, the statement applies to every row: all users are deleted (the empty table remains).
Same danger with UPDATE users SET ... without WHERE: every row changes.
Good habits: write the WHERE first, run a SELECT with the same WHERE to check, and work inside a transaction you can roll back.
Remember
DELETE/UPDATE without WHERE affects every row.