/[cvs.andrew.net.au]/uni/COMP2400/q7.sql
ViewVC logotype

Contents of /uni/COMP2400/q7.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Wed Aug 11 01:30:29 2004 UTC (19 years, 4 months ago) by apollock
Branch: MAIN
Changes since 1.1: +19 -26 lines
Working properly

1 TTITLE "COMP2400: Assignment 1: Question 7"
2
3 COLUMN GRANDCHILD FORMAT A15 HEADING "Grandchild"
4 COLUMN GRANDFATHER FORMAT A20 HEADING "Grandfather"
5 COLUMN GRANDMOTHER FORMAT A20 HEADING "Grandmother"
6
7 BREAK ON GRANDCHILD
8
9 SELECT child.firstname || ' ' || child.surname AS GrandChild, grandfather.firstname || ' ' || grandfather.surname AS grandfather, grandmother.firstname || ' ' || grandmother.surname AS Grandmother
10 FROM parents p, person mother, person father, person child, person grandmother, person grandfather, parents p2, person grandchild
11 WHERE p.personid = child.personid
12 AND father.personid = p.fatherid
13 AND mother.personid = p.motherid
14 AND p2.personid = grandchild.personid
15 AND grandfather.personid = p2.fatherid
16 AND grandmother.personid = p2.motherid
17 AND (p2.personid = p.motherid OR p2.personid = p.fatherid)
18 AND p.personid = '&1';
19
20 EXIT

  ViewVC Help
Powered by ViewVC 1.1.22