{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

relcalc_hard

# relcalc_hard - Relational Calculus(TRC All and Only Queries...

This preview shows pages 1–5. Sign up to view the full content.

1 Relational Calculus (TRC) “All” and “Only” Queries Chapter 4

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Example: Find sailors who’ve reserved all red boats (1) If we can’t (easily) define the answer set, it sometimes helps to negate the definition of the complement of the answer set! For example: “All” and “Only” queries Sailors who have reserved all red boats Sailors for which there exists a red boat they have not reserved The answer set The complement of the answer set
3 Find sailors who’ve reserved all red boats (2) The negation of the complement of the answer set: Find all sailors S such it is not true that there exists a red boat B which they have not reserved. {S | S Sailors ¬ ( B Boats (B.color=“red” ¬ ( R Reserves (R.sid = S.sid R.bid=B.bid))))} Sailors who have reserved all red boats Sailors for which there exists a red boat they have not reserved

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Find sailors who’ve reserved all red boats (3) Find all sailors S such that for every boat in B: it is not true
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 13

relcalc_hard - Relational Calculus(TRC All and Only Queries...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online