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; |