Write a create assertion command for the integrity

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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) gpa) (sid Enrolled (sid, cid, grade) (sid 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

{[ snackBarMessage ]}

Ask a homework question - tutors are online