Multiple choice

Evaluate the following DELETE statement:

DELETE employee_id, salary, job_id FROM employees

WHERE dept_id = 40;

Why does the DELETE statement fail when executed?

  1. There is no row with dept_id 90 in the EMPLOYEES table.

  2. The JOB_ID column cannot be deleted because it is a NOT NULL column.

  3. Column names were not specified in the DELETE clause of the DELETE statement.

  4. The EMPLOYEE_ID column cannot be deleted because it is the primary key of the table.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The DELETE statement fails because it incorrectly lists column names in the DELETE clause. The correct DELETE syntax is DELETE FROM table_name WHERE condition - you don't specify columns to delete in DELETE. The DELETE operation removes entire rows, not specific columns. If the goal was to delete rows from employees where dept_id = 40, the correct syntax would be DELETE FROM employees WHERE dept_id = 40. Option A is irrelevant (wrong dept_id anyway). Option B is incorrect because DELETE doesn't have column-level constraints. Option D is incorrect because deleting rows doesn't affect the primary key definition.