I have two SQL-queries I need to convert into tuple relational calculus. The first query
SELECT immobilie.*
FROM immobilie
WHERE 'Preis'<'100000'
seems to be pretty obvious (if I understood it right):
{w|w ϵ MAKLER ∧ w.Preis < `100000‘}
But the second one:
SELECT makler.*
FROM makler
JOIN immobilie
ON makler.MaklerID = immobilie.angebotenVon
WHERE immobilie.Typ = 'Wohnung'
has a join and I couldn't find a good example how I would need to convert it. Could anyone help me with an explanation?
Most of the materials on TRC seems to be in pdf format. That might have something to do with the symbols heavily used. According to this presentation on Berkeley CS 106 this should work:
Basically, the condition is that an element should exist in another query: for each tuple taken from
MAKLERensure there ∃xists tuple inIMMOBILIEthat haveTypequal to'Wohnung'andangebotenVonequal toMaklerIDof the tuple in consideration.Unfortunately I have no way to test it at the moment.