Freelance
$10
TBD
Sep 25, 2017
Consider the following database which has the following relations:
Movies ( title*, year*, length, genre, studioName, producer_id )
Stars ( movieTitle*, movieYear*, starName* )
MovieStar ( name*, address, gender, birthdate )
MovieExec ( name*, id, address, networth )
Studio ( name*, address, president_id )
Column names with an asterisk (*) next to them are the primary keys.
Where movie executives can be producers or studio presidents, and they have unique
id numbers. Assume that names of people are unique, there is one producer of each
movie, and each studio has one president.
Express the following queries using SQL.
1. Find the names of presidents of studios that released a movie in 2017.
2. Find movies which star more than 10 movie stars.
3. Find movie stars who only star in movies produced by “Guillermo del Toro”.
4. Find the titles of movies that have been used for two or more movies.
5. Find names of movie stars who only star in movies produced by producers who
have a less than average networth.
6. Find years where more than 3 horror movies were released.
7. Find names of movie execs who produce movies longer than 120 minutes or star
“Kit Harrington”
8. Find names of movie stars who starred in no movies produced by “Columbia
Pictures” in 2017 (Using the “EXCEPT” operator)
9. Find names of movie stars who starred in no movies produced by “Columbia
Pictures” in 2017 (Without using the “EXCEPT” operator)
10.Find movie stars who only star in movies that are produced by producers that
have the same address as them