Question: In the book Public Library , Ali Smith writes, It doesnt have to be educational. It doesnt matter who you are or what you were

In the book Public Library, Ali Smith writes, It doesnt have to be educational. It doesnt matter who you are or what you were doing. Young or old. Rich or homeless. It doesnt matter. You just go there. These 'palaces of the people' are civic sites where everyone is welcome. They have an excellent library. Consider the following schema for the library database:

Book (ISBN, title, edition, year)

BookCopy (copyNo, ISBN, available)

Borrower (borrowerNo, borrowerName, borrowerAddress)

BookLoan(copyNo, dateOut, dateDue, borrowerNo)

Where

Book contains details of book titles in the library and the ISBN is the primary key.

BookCopy contains details of the individual copies of books in the library and copyNo is the primary key. ISBN is a foreign key identifying the book title.

Borrower contains details of library members who can borrow books and borrowerNo is the key.

BookLoan contains details of the book copies that are borrowed by library members and copyNo/dateOut forms the primary key. borrowerNo is a foreign key identifying the borrower.

Given the schema above, write the SQL statements for the following queries.

1. List details of all borrowers ordered by name.

2. List all book titles published between 2015 and 2019.

3. List the number of copies of each book title currently available in the Library.

4. List all book titles that have never been borrowed.

5. List details of all borrowers who have not given their addresses.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!