[prev] 57 [next]

Exercise 8: Alternative Join Plans

Consider the schema

Students(id,name,....)   Enrol(student,course,mark)
Staff(id,name,...)    Courses(id,code,term,lic,...)

the following query on this schema

select c.code, s.id, s.name
from   Students s, Enrol e, Courses c, Staff f
where  s.id=e.student and e.course=c.id
       and c.lic=f.id and c.term='11s2'
       and f.name='John Shepherd'

Show some possible join trees/orders for this query.