1. Suppose that for an entity E, there are two candidate keys, A and B. If we make A the primary key, what should we do with B a) make it a SERIAL field b) just treat it like a regular attribute c) use the UNIQUE constraint d) use the NOT NULL constraint 2. Suppose we have the following relational model: Movie(mov_id(PK), title, yr) Person(pid(PK), fname, lname, gender) Acts_In(actor_id(PFK), movie_id(PFK), role) -- actor_id references Person, movie_id references Movie What would be true of the following query? SELECT title, yr FROM Movie m WHERE NOT EXISTS (SELECT * FROM Movie m2 WHERE m1.title = m2.title) a )Movies with an empty string title b) Movies where no other movie has the same title c) Movies where at least one other movie has the same title d) Movies with a null title.
1. Suppose that for an entity E, there are two candidate keys, A and B. If we make A the primary key, what should we do with B
a) make it a SERIAL field
b) just treat it like a regular attribute
c) use the UNIQUE constraint
d) use the NOT NULL constraint
2.
Suppose we have the following relational model:
Movie(mov_id(PK), title, yr)
Person(pid(PK), fname, lname, gender)
Acts_In(actor_id(PFK), movie_id(PFK), role) -- actor_id references Person, movie_id references Movie
What would be true of the following query?
SELECT title, yr
FROM Movie m
WHERE NOT EXISTS
(SELECT *
FROM Movie m2
WHERE m1.title = m2.title)
a )Movies with an empty string title
b) Movies where no other movie has the same title
c) Movies where at least one other movie has the same title
d) Movies with a null title.
Step by step
Solved in 3 steps