SQL- Practice Problem3
SQL- Practice Problem3
Question 1: Consider the LIBRARY relational database schema given below which is used to keep track of books,
borrowers, and book loans.
Page 1 of 2
Question 2. Write down SQL statements for the following queries.
Consider the following Movie database for all the questions; for simplicity assume that the title of a movie is unique.
The length of the movie is its running time in minutes, and net worth of the studio is its monetary value in dollars.
The underlined attributes are part of the primary key. Foreign keys are studioName, actorSSN, and movieTitle.
i. List all movies made during time period 1970-1990 with a production cost below $7500000, in ascending order
of cost.
ii. List the movies for which no production cost has been specified.
iii. Find the minimum, maximum and average production cost of movies made by Fox Studio?
iv. List the number of movies produced by each studio, consider only those studios that have net worth of at least
10 million US dollars and produced at least 5 movies.
v. Find those actors who starred in at least 3 movies made in 1990-1995 by studios based in California.
vi. List those actor SSN pairs whose last name is the same.
vii. List the name of those actors who worked together in the same movie.
viii. List those actors who have not yet starred in any movie.
ix. Display the name and age of all actors who have appeared in any movie made by Fox Studio but not in the movie
made by Universal Studios.
x. Display the name and age of all actresses who have starred in at least 2 movies made by Universal Studios as
well as in at least 3 movies made by 21st Century Fox.
xi. List all Studios which have net worth greater than Universal Studios’.
xii. List those movie titles along with the studio name in which Actor Tom Hanks did not star. (Note: Name is
divided into first name and last name in Actor table)
xiii. List those actresses who costarred in at least one movie in which actor Harrison Ford has starred.
xiv. List all those studios that have made more movies than Universal Studios or 21st Century Fox during 1990-
2000.
xv. Find those actresses who have worked in more movies than all actors.
xvi. Find the actresses who have worked on all the movies produced by ‘Disney’ studio in year 2000.
Page 2 of 2