SQL Help, I am new to SQl and trying to solve: For a book with ISBN 978075640407
ID: 3714938 • Letter: S
Question
SQL Help, I am new to SQl and trying to solve:
For a book with ISBN 9780756404079, display it’s title, publisher, ISBN, which library (not branch) has it, and total number of copies each library has. Do not show libraries that don’t carry it. Sort results by number of copies in decending order.
I tried:
Select Catalog_Item.Title,(select count(*) from book) as Number_of_Copies, Catalog_Item.publisher, Book.isbn, Library_Name
from catalog_Item, Library,book
where catalog_Item.catalog_Item_ID = Book.catalog_Item_ID and book.isbn = 9780756404079
order by Number_of_copies desc;
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: NUMBERExplanation / Answer
There you go buddy
Any question ask in comments
I enhanced your query
Here it is
Select Catalog_Item.Title,(select count(*) from book) as Number_of_Copies, Catalog_Item.publisher, Book.isbn, library.Library_Name
from catalog_Item, Library,book,branch
where catalog_Item.catalog_Item_ID = Book.catalog_Item_ID and book.isbn = 9780756404079
where branch.library_ID = library.library_ID
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.