CSE 132A Lecture Notes - Lecture 6: Free Variables And Bound Variables
Document Summary
Where t is the only free variable. Produces as answer a table with attributes consisting of all tuples v which make. Range of answer tuple: by default the active domain, unless specified in the query. {t: title | s schedule [s(title) = t(title)]} {t: title | m movie [m(director) = (cid:3247)berto(cid:3248) ^ t(title) = m(title)]} Find actors playing in every movie by berto. {a: actor | y movie [a(actor) = y(actor) ^ m movie [m(director) = (cid:3247)berto(cid:3248) t movie (m(title) = t(title) ^ t(actor) = y(actor))]]} M r [ filer(m) property(m) ] Note: basic sql query uses only (no explicit construct for ) Rule: x r (x) = x r (x) Every s in r satisfies phi(x) iff there is no x in r that violates phi(x) Basic rule: one level of nesting for each (cid:3247) (cid:3248) Example: bars: find the bars serving some beer joe likes.