Question
Create SQL statements for the following scenarios. 1. For each book in the catalog, display it's title, publisher, ISBN, release date, number of pages, and
Create SQL statements for the following scenarios.
1. 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.
2 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.
3. 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.
4. 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.
5. 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.
Branch Librery Branch ID NUMBER Library ID: NUMBER Branch Name: VARCHAR2(30) Branch-Phone VARCHAR2(30) te Branch Address: VARCHAR2(30) Library ID. NUMBER (FK) ???????????????????????? VARCHAR2(30 Librer-Name Library Phone: VARCHAR2(30) Library Address: VARCHAR2(30) Physical ltem Transacion Library Card Physical-ltem,ID: NUMBER Transaction-ID NUMBER Library_Card ID: NUMBER Branch ID NUMBER (FK) Catelog_ltem ID: NUMBER (FK) Copy Number NUMBER Date Purchased DATE Library ID: NUMBER (FK) Customer ID: NUMBER (FK) Card_Number VARCHAR2(30) PIN: VARCHAR2(8) Date Expire DATE Date checkout DATE Date Due: DATE Date Returned: DATE 6- Librery_Card_ID: NUMBER (FK) Physical ltem JD: NUMBER (FK) Catalog tenm Catalog-item-IO: NUMBER Customer Customer-iD: NUMBER Title: VARCHAR2(30) Description: VARCHAR2(30) Publisher VARCHAR2(30) Release Date: DATE Type: VARCHAR2(30) Customer Firstname: VARCHAR2(30) Customer Lastname: VARCHAR2(30) Customer Street VARCHAR2(30) Customer City VARCHAR2(30) Customer State: VARCHAR2(20) Customer Zip: VARCHAR2(10) Book DVD Catalog Item ID NUMBER (FK) Lenqth: VARCHAR2(30) Catalog-lternJD: NUMBER (FK) ISBN: VARCHAR213) Paqes: NUMBER Branch Librery Branch ID NUMBER Library ID: NUMBER Branch Name: VARCHAR2(30) Branch-Phone VARCHAR2(30) te Branch Address: VARCHAR2(30) Library ID. NUMBER (FK) ???????????????????????? VARCHAR2(30 Librer-Name Library Phone: VARCHAR2(30) Library Address: VARCHAR2(30) Physical ltem Transacion Library Card Physical-ltem,ID: NUMBER Transaction-ID NUMBER Library_Card ID: NUMBER Branch ID NUMBER (FK) Catelog_ltem ID: NUMBER (FK) Copy Number NUMBER Date Purchased DATE Library ID: NUMBER (FK) Customer ID: NUMBER (FK) Card_Number VARCHAR2(30) PIN: VARCHAR2(8) Date Expire DATE Date checkout DATE Date Due: DATE Date Returned: DATE 6- Librery_Card_ID: NUMBER (FK) Physical ltem JD: NUMBER (FK) Catalog tenm Catalog-item-IO: NUMBER Customer Customer-iD: NUMBER Title: VARCHAR2(30) Description: VARCHAR2(30) Publisher VARCHAR2(30) Release Date: DATE Type: VARCHAR2(30) Customer Firstname: VARCHAR2(30) Customer Lastname: VARCHAR2(30) Customer Street VARCHAR2(30) Customer City VARCHAR2(30) Customer State: VARCHAR2(20) Customer Zip: VARCHAR2(10) Book DVD Catalog Item ID NUMBER (FK) Lenqth: VARCHAR2(30) Catalog-lternJD: NUMBER (FK) ISBN: VARCHAR213) Paqes: NUMBERStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started