Question: Create SQL statements for the following scenarios. Your response should include SQL statement, output and any other assumptions you have made to arrive at the
Create SQL statements for the following scenarios. Your response should include SQL statement, output and any other assumptions you have made to arrive at the solution. Please provide a single SQL query for each problem.
a. For each book in the catalog, display it's title, publisher, ISBN, release date, number of pages, and whether it's carried in any library ("Yes" or "No"). Sort results by title. Make sure there is no duplicate information.
b. For a book with ISBN 9780756404079, display its title, publisher, ISBN, which library (not branch) has it, and total number of copies each library has. Do not show libraries that dont carry it. Sort results by number of copies in decending order.
c. For each DVD in the catalog, display its title, length, release_date, and how many times it has been checked out by all customers across all libraries. Include those that have not been checked out yet (display as 0). Sort results by title.
d. Display those customers who have checked out the same catalog item more than once. Show customer name, and for each catalog item show title, type, number of check out times, first check out date and last check out date for the item. Sort results by customer first/last name and catalog item title.
e. Show all customers who have checked more books than DVDs. Display customer name, total book checkouts and total DVD checkouts. Sort results by customer first name and last name.









select * from book; uery Result x g SQL 1 All Rows Fetched: 5 in 0.003 seconds CATALOG ITEM-ID |?ISBN PAGES 279 1280 286 1328 4 9780316066525 1079 7 9780756404079 722 079 700 1 9780765365 2 9780765365 99990756404 select * from book; uery Result x g SQL 1 All Rows Fetched: 5 in 0.003 seconds CATALOG ITEM-ID |?ISBN PAGES 279 1280 286 1328 4 9780316066525 1079 7 9780756404079 722 079 700 1 9780765365 2 9780765365 99990756404
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
