Answered step by step
Verified Expert Solution
Link Copied!

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.

  1. 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.
  2. 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

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions