To remove only the records where the status = 'Inactive' from a table named…
2026
To remove only the records where the status = 'Inactive' from a table named Accounts, which query is correct?
- A.
DELETE FROM Accounts WHERE status = 'Inactive';
- B.
DROP FROM Accounts WHERE status = 'Inactive';
- C.
REMOVE FROM Accounts WHERE status = 'Inactive';
- D.
TRUNCATE Accounts WHERE status = 'Inactive';
Attempted by 377 students.
Show answer & explanation
Correct answer: A
To remove specific records from a table based on a condition, use the DELETE statement with a WHERE clause. The correct syntax is "DELETE FROM Accounts WHERE status = 'Inactive';". This targets only rows matching the condition. Other commands like DROP remove entire objects, TRUNCATE removes all data without conditions, and REMOVE is not standard SQL.