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

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

View Full Document Right Arrow Icon
1 Relational Calculus (TRC) “All” and “Only” Queries Chapter 4
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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 that it is both red and there is not
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/18/2009 for the course INFS 614 taught by Professor Staff during the Fall '08 term at George Mason.

Page1 / 13

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online