QUESTION: 10

On 20 de July de 2007, in 1Z0-001, OCA (PL/SQL Developer), ORACLE, by Fabiano Anjos

In SQL Plus You issued this command:

DELETE FROM dept WHERE dept_id = 901;

You received an integrated constraint error because the child record was found. What could you do to make the statement execute?

A: Delete the child record first.
B: You cannot make the command execute.
C: Add a fourth keyword to the command.
D: Add the constraints cascade option to the command.

ANSWER: A

EXPLANATION: Answer A is correct because you need first delete the child record in dependable table for avoid foreign constraint violation.

INCORRECT ANSWERS:

B: You can execute the command if you don’t have child records in other tables for record you need to delete in the parent table DEPT.
C: Adding an additional keyword will not help because foreign constraint will be violated.
D: CASCADE CONSTRAINTS option works only for DROP TABLE command, not for DELETE.

 

Comments are closed.