Which two actions would you take to overcome this error?

Exhibit:

View the Exhibit to see the structure of the EMPLOYEES and DEPARTMENTS tables.
Your organization plans to dissolve the department with department ID 30. You execute the
following command to delete rows from the DEPARTMENTS table:
SQL>delete from DEPARTMENTS
where DEPT_ID = 30;
The command fails and displays the following error:
ERROR at line 1:
ORA-02292: integrity constraint (HR.SYS_C005374) violated – child record found
Which two actions would you take to overcome this error? (Choose two.)

Exhibit:

View the Exhibit to see the structure of the EMPLOYEES and DEPARTMENTS tables.
Your organization plans to dissolve the department with department ID 30. You execute the
following command to delete rows from the DEPARTMENTS table:
SQL>delete from DEPARTMENTS
where DEPT_ID = 30;
The command fails and displays the following error:
ERROR at line 1:
ORA-02292: integrity constraint (HR.SYS_C005374) violated – child record found
Which two actions would you take to overcome this error? (Choose two.)

A.
alter the foreign key constraint to include the cascade option

B.
alter the foreign key constraint to include the on delete cascade option

C.
first, drop the EMPLOYEES table and then delete the rows from the DEPARTMENTS table

D.
first, drop the DEPARTMENTS table and then delete the rows from the EMPLOYEES table

E.
first, delete all of the rows from EMPLOYEES table and then delete the rows from the
DEPARTMENTS table for department id 30

F.
first, delete rows from the EMPLOYEES table for department id 30 and then delete the rows from
the DEPARTMENTS table for department id 30



Leave a Reply 1

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


jean

jean

ORA-02292: integrity constraint violated – child record found
CAUSE

You tried to DELETE a record from a parent table (as referenced by a foreign key), but a record in the child table exists.

you need to update or delete the value into the child table first and then you can delete the corresponding value into the parent table.

A foreign key with CASCADE DELETE means that if a record in the parent table is deleted, then the corresponding records in the child table will automatically be deleted. This is called a cascade delete in Oracle.

E is incorrect. Must delete department id 30 for both parent and child tables