Unnesting OQL Queries
select distinct hotel.price
from hotel in ( select h
from c in Cities,
h in c.hotels
where c.name = “Arlington” )
where exists r in hotel.rooms: r.bed_num = 3;
select distinct h.price
from c in Cities,
h in c.hotels,
r in h.rooms
where c.name = “Arlington”
and r.bed_num = 3;
Previous slide
Next slide
Back to first slide
View graphic version
Notes:
Here is the original query and its normalized form.