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

Diff of /uni/COMP2400/q5.sql

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

revision 1.2 by apollock, Tue Aug 10 01:28:52 2004 UTC revision 1.4 by apollock, Wed Aug 11 22:48:11 2004 UTC
# Line 4  Line 4 
4  -- work. It has not been produced, in whole or in part, by another person.  -- work. It has not been produced, in whole or in part, by another person.
5  -- (signed) Andrew Pollock 4137129  -- (signed) Andrew Pollock 4137129
6    
7  TTITLE "COMP2400: Assignment 1: Question 5"  TTITLE "COMP2400: Assignment 1: Question 5|Andrew Pollock (4137129)"
8    
9  SELECT motherid, fatherid, COUNT(personid) AS children  COLUMN Father HEADING "Father"
10  FROM parents  COLUMN Mother HEADING "Mother"
11  GROUP BY motherid, fatherid;  COLUMN Children HEADING "Number of|children"
12    
13    SELECT father.firstname || ' ' || father.surname AS Father, mother.firstname || ' ' || mother.surname AS Mother, COUNT(p.personid) AS children
14    FROM parents p, person mother, person father
15    WHERE p.motherid = mother.personid
16    AND p.fatherid = father.personid
17    GROUP BY father.firstname, father.surname, mother.firstname, mother.surname;
18    
19  EXIT;  EXIT;

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

  ViewVC Help
Powered by ViewVC 1.1.22