Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the following constraints as tuple-based CHECK constraints on one of the r

ID: 3581451 • Letter: W

Question

Write the following constraints as tuple-based CHECK constraints on one of the relations of our running movies example: If the constraint actually involves two relations, then you should put constraints in both relations so that whichever relation changes, the constraint will be checked on insertions and updates. Assume no deletions; it is not always possible to maintain tuple-based constraints in the face of deletions. A star may not appear in a movie made before they were born No two studios may have the same address. A name that appears in MovieStar must not also appear in MovieExec. A studio name that appears in Studio must also appear in at least one Movies tuple. If a producer of a movie is also the president of a studio, then they must be the president of the studio that made the movie.

Explanation / Answer

1.query-

CREATE TABLE MovieStar(name varchar(20),address varchar(30),gender varchar(10),birthdate date);

CREATE TABLE StarsIn(moviename varchar(20),year number,starname varchar(20),CHECK(YEAR(MovieStar.birthdate)<year));