# Relational calculus in a library

Tags:
1. Feb 4, 2016

### AntoineCompagnie

Let's assume that the Congress library has a database with the
following pattern (the primary keys are in bold)
Borrowing(People, Book, DateBorrowing, ExpectedReturnDate,
EffectiveReturnDate) Lateness(People, Book, DateBorrowing,LatenessFee)
Who are those that have never return a book late in relational algebra? In relational calculus?

I think that in relational algebra, they are: $$\Pi_{People}(Borrowing)\div \Pi_{People}(Delayness)$$ But I'm not sure!

And I definitly don't know how to turn out that in relational calculus...

$$\{t.People|Delayness(t)\wedge\dots$$

Have you any hint?

2. Feb 4, 2016

### Staff: Mentor

I'm not sure there's a division operation in relational algebra or relational calculus (I don't know if there's a difference between these two areas).

In any case, the people who have never returned a book late are those people whose EffectiveReturnDate is on or before their ExpectedReturnDate.