Consider the EMPLOYEE table’s constraint EMPSUPERFK as specified in Figure 4.2 is changed to read as follows:

CONSTRAINT EMPSUPERFK
FOREIGN KEY (SUPERSSN) REFERNCES EMPLOYEE(SSN)
ON DELETE CASCADE ON UPDATE CASCADE,
Answer the following questions:
a. What happens when the following command is run on the database state shown in Figure 5.6?
DELETE EMPLOYEE WHERE LNAME = ‘Borg’
b. Is it better to CASCADE or SET NULL in case of EMPSUPERFK constraint ON DELETE?

a) The James E. Borg entry is deleted from the table, and each employee with him as a supervisor is also (and their supervisees, and so on). In total, 8 rows are deleted and the table is empty.
b) It is better to SET NULL, since an employee is not fired (DELETED) when their supervisor is deleted. Instead, their SUPERSSN should be SET NULL so that they can later get a new supervisor.

Computer Science & Information Technology

You might also like to view...

________ is a free, real-time blogging system in which you send and read short messages of up to 140 characters.

a. Facebook b. LinkedIn c. MySpace d. Twitter

Computer Science & Information Technology

You should set the language in which Alice displays a program to "Alice."

Answer the following statement true (T) or false (F)

Computer Science & Information Technology