Question: Over a relation Borrow ( reader , book,date ) , consider the following SQL expression: select date from Borrow except select date from Borrow where
Over a relation Borrowreaderbook,date consider the following SQL expression:
select date from Borrow
except
select date from Borrow where reader'Ali'
Which statements are correct? In relational algebra we use project to indicate projections and sigma to indicate selections.
An equivalent SQL expression is the following:
select date from Borrow where reader 'Ali'
The expression returns all dates when a book was borrowed by someone else than Ali.
The expression returns all dates when the only reader who borrowed something was Ali.
The following relational algebra expression is NOT equivalent:
projectdateBorrow minus sigmaauthor'Ali'Borrow
We can write the same query in relational algebra as follows:
projectBdate
sigmaBreader 'Ali'
sigmaBdateBdate
renameBBorrow cartprod renameBBorrow
The expression returns all dates when Ali did not borrow a book.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
