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

Diff of /uni/COMP2400/q6.sql

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by apollock, Wed Aug 11 01:30:29 2004 UTC revision 1.4 by apollock, Wed Aug 11 01:46:15 2004 UTC
# Line 8  Line 8 
8    
9  TTITLE "COMP2400: Assignment 1: Question 6"  TTITLE "COMP2400: Assignment 1: Question 6"
10    
11  SELECT motherid, fatherid  COLUMN Mother HEADING "Mother"
12  FROM parents  COLUMN Father HEADING "Father"
13  GROUP BY motherid, fatherid  
14  HAVING COUNT(personid) = (SELECT MAX(COUNT(personid))  SELECT mother.firstname || ' ' || mother.surname AS Mother, father.firstname || ' ' || father.surname AS Father
15                            FROM parents  FROM parents p, person mother, person father
16                            GROUP BY motherid, fatherid);  WHERE p.motherid = mother.personid
17    AND p.fatherid = father.personid
18    GROUP BY mother.firstname, mother.surname, father.firstname, father.surname
19    HAVING COUNT(p.personid) = (SELECT MAX(COUNT(personid))
20                               FROM parents
21                               GROUP BY motherid, fatherid);
22    
23  EXIT;  EXIT;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.22