You are on page 1of 2

Department of Computer Science

1501263 Intro. to Database Management Systems


Fall 2021-2022

iTBL 3-B
Discuss the integrity constraints violation by each operation, if any.

 Insert <‘Cecilia’, ‘F’, ‘Kolonsky’, NULL, ‘1960-04-05’, ‘6357 Windy Lane, Katy, TX’, F, 28000, NULL, 4> into
EMPLOYEE.

Entity integrity , we cannot have Null for the primary key ,solution could be execute a user– specefied
error correction routine.

 Insert <‘Ahmed’, ‘F’, ‘Kamel’, ‘677678989’, ‘1960-04-05’, ‘6357 Windswept, Katy, TX’, F, 28000, ‘987654321’, 7>
into EMPLOYEE.

Refrential integrity constraints . We don’t have department no 7 , and the solution could be trigger
additional updates (set NULL option ) because maybe the employee hasn’t been assigned to a department yet.

 Delete the WORKS_ON tuple with Essn = ‘999887777’ and Pno = 10.

No integrity constraints are violated since the superkey (primary key) is not referenced anywhere.

 Delete the EMPLOYEE tuple with Ssn = ‘888665555’.

Refrential integrity constraint violation , because the ssn is referenced in :


EMPLOYEE,DEPARTMENT,WORKS_ON. Solution : trigger additional updates (cascade updates).

 Update the Dno of the EMPLOYEE tuple with Ssn = ‘999887777’ to 1.

No violation is used to change the values of one or more attributes in a tuple , and this example met the
requirements so no violations found.

 Update the Ssn of the EMPLOYEE tuple with Ssn = ‘999887777’ to ‘987654321’.

Refrential integrity constraint violation, because it references the Essn SK in WORKS_ON ,solution is trigger
updates , but it also violates the key constraint in EMPLOYEE ( Duplication ). Solution : reject the operation.
Department of Computer Science
1501263 Intro. to Database Management Systems
Fall 2021-2022

You might also like