Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Introduction to Oracle 12c SQL and DB concepts: books ( book_id, title, author_last_name, author_first_name, rating) patrons (patron_id, last_name, first_name, street_address, city_state_zip, location) transactions (transaction_id, patron_id,
Introduction to Oracle 12c SQL and DB concepts:
books ( book_id, title, author_last_name, author_first_name, rating)
patrons (patron_id, last_name, first_name, street_address, city_state_zip, location)
transactions (transaction_id, patron_id, book_id, transaction_date, transaction_type)
*Book_Id, Patron_id and Transaction_id are primary keys. Patron_id and book_id in transactions table are foreign keys.
Possible values for the transaction type are 1 = checking out , 2 = returning 3 = placing a hold.
- Write SQL to list all patrons and their number of transactions for each transaction type. Include all patrons even if they do not have transactions.
- Write SQL to list all the books (book ids and first 10 characters of the title) and their total number of transactions in 2013. Include all books even if they have no transactions (count should be 0). Sort the results by the most popular book (the book with the most transactions).
Step 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