Unformatted text preview: a CREATE ASSERTION command for the integrity constraint:
Every manager must also be an employee. 23 Database Management Systems, 3rd ed., Ramakrishnan and Gehrke, Section 3.3 24 Enforcing Integrity Constraints
(continued) Enforcing Integrity Constraints
(continued) What about referential integrity constraints? Options for handling deletion problems with Students: Suppose we have tables for:
Students (sid, name, login, age, gpa)
Enrolled (sid, cid, grade)
sid is a FK that references Students. • Delete all Enrolled tuples that refer to deleted Students tuple.
• Disallow deletion of Students tuple if an Enrolled tuple refers to it.
• Set student ID field to some existing “default” student for every Enrolled tuple
that refers to the deleted Students tuple. How can insertions into Enrolled cause a problem?
How can deletions from Students cause a problem?
How can modifications in either table cause a problem? • For every Enrolled tuple that refers to it, set student ID field to null....
View Full Document
- Fall '12
- MYSQL , Foreign key, sailors, Sid