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 Borrow(reader,book,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:
project[date](Borrow minus sigma[author='Ali'](Borrow))
We can write the same query in relational algebra as follows:
project[B1.date]
sigma[B1.reader <> 'Ali']
sigma[B1.date=B2.date]
(rename[B1](Borrow) cart-prod rename[B2](Borrow)
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!