0% found this document useful (0 votes)
41 views

Assignment # 4 (Fall-2021)

The document provides instructions for assignment 4 on database systems. It describes tables for a library database including books, book copies, borrowers, and book loans. It lists 14 queries to formulate in relational algebra using the tables. The assignment is due on January 14th and should be handwritten and submitted in the instructor's office.

Uploaded by

Ali Raza
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Assignment # 4 (Fall-2021)

The document provides instructions for assignment 4 on database systems. It describes tables for a library database including books, book copies, borrowers, and book loans. It lists 14 queries to formulate in relational algebra using the tables. The assignment is due on January 14th and should be handwritten and submitted in the instructor's office.

Uploaded by

Ali Raza
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment # 4 (Fall-2021)

Subject: Intro to Database Systems Class: BSSE-3-S2

Instructions:
Assignment solution should be handwritten. The deadline is Friday, January 14, 2021 before
5:00 pm and submit it in my office.

Q #1: The following tables are the description of a 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 key.
 BookCopy contains details of the individual copies of books in the library and copyNo is
the 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 key. borrowerNo is a foreign key identifying the borrower.

Formulate the following queries in relational algebra.


1. List all book titles.
2. List all borrower details.
3. List all book titles published in the year 2012.
4. List all copies of book titles that are available for borrowing.
5. List all copies of the book title Lord of the Rings that are available for borrowing.
6. List the names of borrowers who currently have the book title Lord of the Rings on loan.
7. List the names of borrowers with overdue books.
8. How many copies of ISBN “0-321-52306-7” are there?
9. How many copies of ISBN “0-321-52306-7” are currently available?
10. How many times has the book title with ISBN “0-321-52306-7” been borrowed?
11. Produce a report of book titles that have been borrowed by “Peter Bloomfield.”
12. For each book title with more than three copies, list the names of library members who
have borrowed them.
13. Produce a report with the details of borrowers who currently have books overdue.
14. Produce a report detailing how many times each book title has been borrowed.

Q # 2: Describe the relations that would be produced by the following relational algebra
operations:

You might also like