Question: SQL newbie, lost in the logic I need. I am solving: Display those customers who have checked out the same catalog item more than once.
SQL newbie, lost in the logic I need. I am solving: 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.
I can tell I have to join Customer to Library_Card to transaction in order to find out how many times a customer checked something out but I am making error
s left and right in getting the code correct for showing the number of times that customer checked out that particular item and I am having trouble with gettign the first check out date.
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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
