What happens when you execute this DELETE statement?

You own a table called EMPLOYEES with this table structure:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATE
What happens when you execute this DELETE statement?

DELETE employees;

You own a table called EMPLOYEES with this table structure:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATE
What happens when you execute this DELETE statement?

DELETE employees;

A.
You get an error because of a primary key violation.

B.
The data and structure of the EMPLOYEES table are deleted.

C.
You get an error because the statement is not syntactically correct.

D.
The data in the EMPLOYEES table is deleted but not the structure.

Explanation:

: You can remove existing rows from a table by using the DELETE statement.
DELETE [FROM] table
[WHERE condition];



Leave a Reply 6

Your email address will not be published. Required fields are marked *


kishan

kishan

Answer is : C beacuse it is not syntactically correct.
the correct answer is : delete from employees;

WELLINGTON

WELLINGTON

in fact this syntax is not correct in ANSI SQL, but the Oracle allows that syntax.
“DELETE EMPLOYEES”, on Oracle, has the same effect than “DELETE FROM EMPLOYEES” and the correct answer is D.

William T Marera

William T Marera

I also thought that this syntax is wrong. So i run it and all the rows were deleted.