Which one of the 2 approaches below is better provided indexes are availabe on the columns - id & dno in respective tables.
Code: Select all
select f.dno, d.dname, c.sname....
into :f-dno, :d-dname, :c-sname...
from
faculty f, dept d, stud s
where f.dno = d.dno
and f.dno = s.dno
and f.id = :host-var-fac-id
Code: Select all
select f.dno,... into :f-dno,...
from faculty f where f.id = :host-var-fac-id
select d.dno, d.dname.... into :d-dno,....
from dept d where d.dno = :f-dno
select s.dno, s.sname... into :s-dno,...
from stud s where s.dno = :d-dno
----------------------------------------------------
Elaborate explanation would be appreciated[/code]