Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Run the script DBST651_final_Part2_q2.sql attached and then respond the following SQL problems: Create SQL statements for the following scenarios. Your response should include SQL statement,

Run the script DBST651_final_Part2_q2.sql attached and then respond the following SQL problems:

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles Of Multimedia Database Systems

Authors: V.S. Subrahmanian

1st Edition

1558604669, 978-1558604667

More Books

Students also viewed these Databases questions