Suppose you are not allowed to use the FOREIGN KEY clause. How can you express foreignkey constraints?
For example, suppose we have a table Professor with attributes Id, name, etc., where Id is
the primary key and a table Teaches with attributes ProfId, CrsCode, etc. How would you
specify the constraint that each professor teaches exactly one course?
Use the following SQL assertion:
CREATE ASSERTION EachProfTeachExactlyOneCourse
CHECK (NOT EXISTS
(SELECT * FROM Professor P
WHERE (SELECT COUNT(*) FROM Teaches A
WHERE P.Id = T.ProfId) <> 1))
You might also like to view...
The main method executes in the ________ thread of execution.
a. starting b. main c. local d. None of the above.
Which of the following properties creates a 3D shadow effect like the kind in the accompanying figure?
A. 3D-shadow B. box-shadow C. drop-shadow D. h-shadow
Even if you change the color of a page background using the Page Color button under the DESIGN tab, the colored background may still not print
Indicate whether the statement is true or false
What is a directed path?
What will be an ideal response?