SQL Assignment6
SQL Assignment6
SQL Assignment6
2. Which movie was rented for the longest duration (by any customer)?
3. Which suppliers supply all the movies in the inventory? (Hint: first get a
list of the movie suppliers and all the movies in the inventory using the
cross product. Then find out which of these tuples are invalid.)
4. How many movies in the inventory does each movie supplier supply?
That is, for each movie supplier, calculate the number of movies it
supplies that also happen to be movies in the inventory.
Select S.SupplierName, Count (Distinct S.MovieID) FROM Suppliers S,
MovieSupplier MS, Movies M where S.SupplierID = MS.SupplierID and
MS.MovieID = M.MovieID GROUP BY S.SupplierName
7. For which movies are there more than 1 copy in our inventory? (Note that
the TapeID in inventory is different for different copies of the same
MovieID)
9. Which supplier has the cheapest price for the movie "Almost Angels
1962"?