select first_name,last_name,job_title, department_name from hr.employees join hr.jobs using (job_id) join hr.departments using (department_id) where job_title like '%Manager%';
a nie náhodou:
MV1 <-- σ job_title like '%Manager%' (jobs)
MV2 <-- MV1 ⋈ job_id = job_id jobs
MV3 <-- MV2 ⋈ department_id = department_id departments
V <-- π first_name,last_name,job_title, department_name (MV3)
lebo:
select spz,typ,count(*) from auto join asz using (spz) where typ in ('o','O') group by spz,typ having count(*) = 2;
MV1<-- σ s typ = 'o' OR typ = 'O' (auto)
MV2 <-- MV1 ⋈ spz = spz asz
MV3(spz,typ,pocet) <-- spz, typ F COUNT spz (MV2)
V(spz,typ,pocet) <-- s pocet = 2(MV3)
a nie náhodou:
MV1 <-- σ job_title like '%Manager%' (jobs)
MV2 <-- MV1 ⋈ job_id = job_id jobs
MV3 <-- MV2 ⋈ department_id = department_id departments
V <-- π first_name,last_name,job_title, department_name (MV3)
lebo:
select spz,typ,count(*) from auto join asz using (spz) where typ in ('o','O') group by spz,typ having count(*) = 2;
MV1<-- σ s typ = 'o' OR typ = 'O' (auto)
MV2 <-- MV1 ⋈ spz = spz asz
MV3(spz,typ,pocet) <-- spz, typ F COUNT spz (MV2)
V(spz,typ,pocet) <-- s pocet = 2(MV3)