Skip to main contentSkip to solution

Choose the correct syntax for deleting one or more records from the table based on a condition.

Solution

✅ Correct Option: 4

The SQL syntax for deleting rows that meet a condition is DELETE FROM tablename WHERE condition;\texttt{DELETE FROM tablename WHERE condition;}. The WHERE clause picks which rows to remove, and without it every row in the table is deleted.


Options 1 and 2: HAVING filters groups after GROUP BY, not individual rows, so it cannot be used here.

Option 3: WHERE is correct, but the word TABLE after FROM is not valid in DELETE syntax. TABLE is used in DROP TABLE and CREATE TABLE.

DELETE removes rows and keeps the table structure, while DROP TABLE removes the whole table.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question