Skip to main contentSkip to solution

Which SQL Query below is correct for deleting all records from 'Products' table having product names starting with 'M'?

Solution

✅ Correct Option: 1

The SQL command to delete rows from a table is DELETE FROM table WHERE condition;. To match names starting with 'M', the condition uses LIKE with the wildcard %, which stands for any number of characters. So ProductName LIKE 'M%' selects every name beginning with M, and DELETE FROM Products WHERE ProductName LIKE 'M%'; removes exactly those rows.


Options 2 and 4: REMOVE is not an SQL command.

Option 3: DROP deletes whole objects such as a table or database, not rows, and has no DROP FROM form.

Options 3 and 4: IS works only with NULL (for example IS NULL), not with pattern matching.

Keyboard Shortcuts

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