Consider Ullman and Widom’s movie database example: Movies (title, year, length,
ID: 3674823 • Letter: C
Question
Consider Ullman and Widom’s movie database example:
Movies (title, year, length, genre, studioName, producerC#)
StarsIn (movieTitle, movieYear, starName)
MovieStar (name, address, gender, birthdate)
MovieExec (name, address, cert#, netWorth)
Studio (name, address, presC#)
Write SQL queries to answer the following questions:
A. List all the information in the Movies table in with name as the primary sort key and date as the secondary sort key.
B. What year was Star Wars released?
c. List the name and gender for all stars who have appeared in comedies.
d. How many movies of each genre are there? List the genres and number in each.
e What movies were made by Paramount after 1990? List in order of ascending date.
Explanation / Answer
A.
select * from Movies order by title, year;
B.
select movieYear from StarsIn where movieTitle='Star Wars';
C.
select name, gender from moviestar, movieexec where name=movieexec.name and cert#='comedies';
D.
select count(title) from movies group by genre;
e.
select title from movies where studioname = 'Paramount' and year >1990 order by title;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.