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

Annotation of /uni/COMP2400/q6.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations)
Wed Aug 11 22:48:11 2004 UTC (18 years, 1 month ago) by apollock
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +3 -2 lines
Base questions ready for submission

1 apollock 1.1 -- I have read the ANU Code on "Academic Honesty in Learning and Teaching",
2     -- and I declare that, except where appropriately attributed, the content
3     -- of the file I have submitted for this assignment is entirely my own
4     -- work. It has not been produced, in whole or in part, by another person.
5     -- (signed) Andrew Pollock 4137129
6    
7 apollock 1.3 -- Find the couple(s) with the most children
8    
9 apollock 1.5 TTITLE "COMP2400: Assignment 1: Question 6|Andrew Pollock (4137129)"
10 apollock 1.2
11 apollock 1.4 COLUMN Mother HEADING "Mother"
12     COLUMN Father HEADING "Father"
13 apollock 1.5 COLUMN Children HEADING "Number|of children"
14 apollock 1.4
15 apollock 1.5 SELECT mother.firstname || ' ' || mother.surname AS Mother, father.firstname || ' ' || father.surname AS Father, COUNT(p.personid) AS Children
16 apollock 1.4 FROM parents p, person mother, person father
17     WHERE p.motherid = mother.personid
18     AND p.fatherid = father.personid
19     GROUP BY mother.firstname, mother.surname, father.firstname, father.surname
20     HAVING COUNT(p.personid) = (SELECT MAX(COUNT(personid))
21     FROM parents
22     GROUP BY motherid, fatherid);
23 apollock 1.2
24     EXIT;

  ViewVC Help
Powered by ViewVC 1.1.22