469,641 Members | 1,116 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,641 developers. It's quick & easy.

Database theory question: safe query

Hi all,

Excuse me if this is not the right place to ask this .., but it's the
closest I could find.

I am reading Ramakrishnan and Gehrke "Database Management Systems". In
their errata for the second edition at
http://www.cs.wisc.edu/~dbbook/openA...errata1st.html
it says

'Page 111, Q9: The tuple relational calculus expression for Q9 is
unsafe if "Boats" is empty. A corrected version of the query is the
following expression: { P | there exists S in Sailors (P.sname =
S.sname and for all R in Reserves (S.sid = R.sid and R.bid = B.bid))
}'

I have two questions about this:

1) why is the query (in the book) not safe if Boats is empty ?

2) How does the corrected query answer the task : 'Find the names of
sailors who have reserved all boats'? What if nobody reserved some
boat -- his/her name will still be selected in the corrected query ?!?

I would appreciate very much if somebody could shed some light on
this.

Regards,

Janis
Nov 11 '05 #1
0 1235

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Markus Seibold | last post: by
19 posts views Thread by nospammmer | last post: by
12 posts views Thread by grace | last post: by
3 posts views Thread by Paul | last post: by
7 posts views Thread by erikcw | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.