EliteVideo is a startup company providing concierge DVD kiosk service in upscale
ID: 3760626 • Letter: E
Question
EliteVideo is a startup company providing concierge DVD kiosk service in upscale neighborhoods. EliteVideo can own several copies (VIDEO) of each movie (MOVIE). For example, the store may have ten copies of the movie “Titanic”. “Titanic” would be one MOVIE and each copy would be a VIDEO. A rental transaction (RENTAL) involves one or more videos being rented to a member (MEMBERSHIP). A video can be rented many times over its lifetime, therefore, there is a M:N relationship between RENTAL and VIDEO. DETAILRENTAL is the bridge table to resolve this relationship. The complete ERD is shown in the figure below.
1.Write a query to display the movie title, movie year, price description, and price rental fee for all movies that are in the genres Family, Comedy, or Drama.
2.Write a query to display the membership number, last name, and total rental fees earned from that membership. The total rental fee is the sum of all of the detail fees (without the late fees) from all movies that the membership has rented.
Explanation / Answer
1. select m.movie_title,
m.movie_year,
p.price_description,
p.price_rentfee,
m.movie_genre
from movie m, price p
2.
SELECT DISTINCTROW MEMBERSHIP.Mem_Num, MEMBERSHIP.Mem_FName, MEMBERSHIP.Mem_LName, Sum(DETAILRENTAL.Detail_Fee) AS [Sum Of Detail_Fee]
FROM (MEMBERSHIP INNER JOIN RENTAL ON MEMBERSHIP.[Mem_Num] = RENTAL.[Mem_Num]) INNER JOIN DETAILRENTAL ON RENTAL.[Rent_Num] = DETAILRENTAL.[Rent_Num]
GROUP BY MEMBERSHIP.Mem_Num, MEMBERSHIP.Mem_FName, MEMBERSHIP.Mem_LName;
WHERE M.PRICE_CODE = P.PRICE_CODE
and m.movie_genre in ('FAMILY', 'COMEDY', 'DRAMA');
(tips:Add Mem_Num, Mem_LName, Mem_FName from the Membership table, Detail_Fee from the DetailRental table)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.