Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Q2: get details of the current Deans of Faculty
- create or replace view Q2(name, faculty, phone, starting)
- as
- select names.name, faculties.longname, phonenums.phone, deans.starting from
- (select id, longname from orgunits
- group by id
- having utype = 1) as faculties
- inner join
- (select staff, orgunit, starting from affiliations
- where role = 1286) as deans
- on faculties.id = deans.orgunit
- inner join
- (select id, phone from staff) as phonenums
- on phonenums.id = deans.staff
- inner join
- (select unswid, name from people) as names
- on names.unswid = deans.staff
- --... SQL statements, possibly using other views/functions defined by you ...
- ;
- /*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement