Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this assignment. Please use assignment operator for each question and explain why the answer is what it is. Consider a library

I need help with this assignment. Please use assignment operator for each question and explain why the answer is what it is.

Consider a library database with the following schema (where primary keys are in parenthesis):

Book( (bookID), ISBN, title, author, publish-year, category)

Member((memberID), (lastname), (firstname), address, phone-number, limit)

CurrentLoan((memberID), (bookID), loan-date, due-date)

History((memberID), (bookID), (loan-date), return-date)

Members can borrow books from the library. The number of books they can borrow is limited by the limit field of the Member relation. The category of a book includes fiction, non-fiction, childrens and reference. The CurrentLoan table represents the information about books that are currently checked out. When the book is returned to the library, the record will be removed from CurrentLoad relation, and will be inserted into History relation with the return-date. A library may have more than one copy of the same book, in which case each copy has its own bookID, but all copies share the same ISBN.

Express each of the following tasks in relational algebra.

(5 pts) Find the ISBN and title of all the books authored Arthur Miller.

(8 pts) List the bookID and title of all the books that are currently checked out by John Smith. Do not use any natural join in this query.

(8 pts) Find the first name and last name of the members who are either currently borrowing book Da Vinci Code or have borrowed it in the past.

(6 pts) Find the memberID, first name, and last name of the members who have never borrowed any books.

(8 pts) List the first and last names of members who have borrowed (either currently or in the past) all the books in the library that are authored by Arthur Miller. If some books authored by Arthur Miller have multiple copies, he or she must have borrowed at least one copy of each of Arthur Millers books.

(5 pts) Find the total number of books for each category (write a single query for this question).

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

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions