Question
Suppose that we have the following database schema: Book(BId, title, PName, AId) PName foreign key referencing Publisher, Aid foreign key referencing Author Author(AId, Name) Publisher(PName,
Suppose that we have the following database schema:
Book(BId, title, PName, AId) PName foreign key referencing Publisher, Aid foreign key referencing Author
Author(AId, Name)
Publisher(PName, Address, Phone)
BookLoan(BId, CardNo, DateOut, DueDate) BId foreign key referencing Book, CardNo foreign key referencing Borrower
Borrower(CardNo, Name, Address, Phone)
1- Write down the following queries in SQL:
a. Retrieve the book title and the number of its copies.
b. Retrieve the title and the due date of the book borrowed by Mshari.
c. Retrieve the number of books titled Network borrowed by Mshari
d. Give the number of borrowers who borrowed database book more than 3 times
Rewrite the queries in relational algebra language
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started