Question: We expect the constraint an instructor cannot teach sections in two different classrooms in a semester in the same time slot to hold. a. Write
We expect the constraint “an instructor cannot teach sections in two different classrooms in a semester in the same time slot” to hold.
a. Write an SQL query that returns all (instructor, section) combinations that violate this constraint.
b. Write an SQL assertion to enforce this constraint (as discussed in Section 4.4.8, current generation database systems do not support such assertions, although they are part of the SQL standard).
Step by Step Solution
3.38 Rating (167 Votes )
There are 3 Steps involved in it
a SELECT DISTINCT instructor section FROM teaches WHERE EXISTS SELECT FROM teaches AS t1 WHERE t1... View full answer
Get step-by-step solutions from verified subject matter experts
