Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question#2: - Consider the LIBRARY relational schema, which is used to keep trac

ID: 3733815 • Letter: Q

Question

Question#2: - Consider the LIBRARY relational schema, which is used to keep track of books, borrowers, and book loans:

- Write down relational Algebra expressions for the following queries on the LIBRARY database:

(a) Find all titles of books

(b) Find all title and name of publisher for all books.

(c) Retrieve all borrowers’ names and phones who live in UK, ABC Street

(d) Retrieve all authors' names of the book titled The Lost Tribe

(e) How many copies of the book titled The Lost Tribe are owned by the library branch whose name is "Sharpstown"?

(f) How many copies of the book titled The Lost Tribe are owned by each library branch?

(g) Retrieve the names of all borrowers who do not have any books checked out.

(h) For each library branch, retrieve the branch name and the total number of books loaned out from that branch.

BOOK Book id Title Publisher_name BOOK_AUTHORS Book id Author name PUBLISHER Name Address Phone BOOK COPIES Book_id Branch_id No of_copies BOOK LOANS Book id Branch id Card no Date_out Due_date LIBRARY BRANCH Branch_idBranch name| Address BORROWER Card_no Name Address Phone

Explanation / Answer

a) select Title from Book

b) select Title, Publisher_name from Book

c) select Name, Phone from BORROWER where Address = 'UK, ABC Street'

d) select Author_name from Book_Authors natural join Book where Book.Title = 'The Lost Tribe'

e) select No_of_copies from Book natural join Book_Copies natural join Library_Branch where Branch_Name = 'Sharpstown'

f)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote