(TCO 5) The business intelligence database for a company that rents videos for o
ID: 3596765 • Letter: #
Question
(TCO 5) The business intelligence database for a company that rents videos for online streaming includes the following tables and fields.
Videos: VideoID (PK, integer), VideoTitle (text(50)), Genre(text(20)), DirectorID(FK, integer), NumberOfRentals (integer)
Directors: DirectorID (PK, integer), DirectorLastName (text(30)), DirectorFirstName (text(30))
(a) Write an SQL query to display the VideoID, VideoTitle, and NumberOfRentals for all videos, sorted in order by NumberOfRentals, so that the most-rented video appears at the top of the page.
(b) Write an SQL query to display the VideoID, VideoTitle, and NumberOfRentals for videos with the genre science fiction.
(c) Write an SQL query to display the VideoID, VideoTitle, NumberOfRentals, and the associated DirectorLastName and DirectorFirstName for all videos that have more than 100 rentals.
Explanation / Answer
a)select VideoID,VideoTitle,NumberOfRentals
From Videos
Order by NumberOfRentals desc
b)select VideoID,VideoTitle,NumberOfRentals
From Videos
where Genre='Science Fiction'
c)select VideoID,VideoTitle,NumberOfRentals,DirectorLastName,DirectorFirstName
From Videos,Directors
where NumberOfRentals>100
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.