Given a table Employees with rows:
id | name | department 1 | Alice | Sales 2 | Bob | HR 3 | Charlie | Sales 4 | Diana | IT
What rows remain after running this query?
DELETE FROM Employees WHERE department = 'Sales';
SELECT * FROM Employees;
DELETE removes rows matching the WHERE condition.
The DELETE query removes all employees in the Sales department, leaving only Bob and Diana.
Which DELETE query will remove only the employee with id = 3 from the Employees table?
Use WHERE to target a specific row by id.
Option D deletes only the row where id equals 3. Option D deletes all Sales employees. Option D deletes all rows. Option D is invalid syntax.
What is wrong with this DELETE statement?
DELETE Employees WHERE id = 5;
Check the correct DELETE syntax.
The correct syntax requires the FROM keyword: DELETE FROM Employees WHERE id = 5;
You want to delete employees with ids 2, 4, and 6. Which query is best?
Use concise syntax for multiple values.
Option A uses IN which is clearer and often optimized by the database engine. Option A is longer but works. Options B and D delete extra rows.
Given this query:
DELETE FROM Employees WHERE department = 'Marketing' OR 1=1;
Why does it delete all rows?
Think about how OR conditions work in WHERE.
The condition '1=1' is always true, so the WHERE clause matches every row, causing all rows to be deleted.