Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a sample database schema representing a library management system with the following tables: Books: book_id (Primary Key) title author genre publication_year Members: member_id (Primary

Consider a sample database schema representing a library management system with the following tables:

  1. Books:

    • book_id (Primary Key)
    • title
    • author
    • genre
    • publication_year
  2. Members:

    • member_id (Primary Key)
    • name
    • email
    • registration_date
  3. Borrowings:

    • borrowing_id (Primary Key)
    • book_id (Foreign Key)
    • member_id (Foreign Key)
    • borrow_date
    • return_date

Write SQL queries to accomplish the following tasks:

a) Retrieve all books published in the year 2020.

b) List the names and email addresses of members who registered after January 1, 2021.

c) Count the total number of borrowings made by each member, and display the member's name along with the count.

d) Find the titles of the books borrowed by a member with the name 'John Doe'.

e) Calculate the average number of days each book is borrowed before being returned, and display the title of the book along with the average borrowing duration.

f) List the names of members who have borrowed books but have not returned them yet.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Here are the SQL queries to accomplish the tasks a Retrieve all books published in the year 2020 SEL... 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

Accounting Information Systems

Authors: Marshall B. Romney, Paul J. Steinbart

13th edition

133428532, 978-0133428537

More Books

Students also viewed these Databases questions

Question

What is flexible automation and what are some of its features?

Answered: 1 week ago

Question

Summarize the impact of stress on physical well-being.

Answered: 1 week ago