Which SQL statement will delete records from table CLUB for members whose TYPE…

2017

Which SQL statement will delete records from table CLUB for members whose TYPE is 'ANNUAL' or whose DOJ is on or after 01-JAN-2010? In these options, '01-JAN-10' denotes 01-JAN-2010.

  1. A.

    DELETE FROM CLUB WHERE TYPE = 'ANNUAL' AND DOJ >= '01-JAN-10';

  2. B.

    DELETE FROM CLUB WHERE TYPE = 'ANNUAL' OR DOJ > '01-JAN-10';

  3. C.

    DELETE * FROM CLUB WHERE TYPE = 'ANNUAL' OR DOJ > '01-JAN-10';

  4. D.

    DELETE FROM CLUB WHERE TYPE = 'ANNUAL' OR DOJ >= '01-JAN-10';

Attempted by 1486 students.

Show answer & explanation

Correct answer: D

The condition has two parts:
1. TYPE = 'ANNUAL'
2. DOJ is on or after 01-JAN-2010

Because the question says 'or', the WHERE clause must use OR, not AND. Because it says 'on or after', the date comparison must use >=, not >. The correct DELETE syntax is DELETE FROM table_name WHERE condition.

Therefore, the correct statement is:
DELETE FROM CLUB WHERE TYPE = 'ANNUAL' OR DOJ >= '01-JAN-10';

Here, '01-JAN-10' is being used in the option set to denote 01-JAN-2010.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Up Lt Grade Assistant Teacher 2025