IPT home IPT A Virtual Approach by Peter Whitehouse
Quick Links:
 
 
IIS home
Information and Intelligent Systems Social and Ethical Implications Human Computer Interaction Software and Systems Engineering eXercise Files Course Outline and Assessment A-Z of Geeky Acronyms Terrace Work Program 2004 Sillybus FAQ = Frequently Asked Questions Help
 
 

Database Languages

eXercise #9


Exercises in Joining (mostly)

Referring to the following FAMILY TREE:

a family tree

It has been decided to record the above information using the table system outlined below. One of many advantages of the table system chosen is the ability to determine a person's relations (eg. Mother, Father, Uncle, Cousin etc.)

PEOPLE
Person Sex Born Nationality
Gerry M 1941 Australian
Rhonda F 1943 British
Sybil F 1963 Australian
Gina F 1985 Australian
Frank M 1937 American
Mary F ? American
Paul M 1962 American
Peter M 1963 Australian
Joe M 1984 ?
Steven M 1942 British
Sue F 1941 American
Paula F 1964 American
Harry M 1963 ?
Alan M 1986 ?
FAMILY
Person Parent
Sybil Gerry
Sybil Rhonda
Paul Frank
Paul Mary
Peter Frank
Peter Mary
Paula Steven
Paula Sue
Gina Sybil
Gina Paul
Joe Peter
Joe Paula
Harry Frank
Harry Rhonda
Alan Paul

These tables exist in a Database you can download in Access format

or via the PUBLIC DATABASE PORTAL

Draw DIAGRAMS and then write and test queries that answer the following:

  1. List all persons in the family table, be they child or parent (use a UNION query).
  2. List all male children.
  3. List all children born after 1965.
  4. List all children born between 1960 and 1970.
  5. List all Australian children in alphabetical order.
  6. List all of children of Mary born after 1962.
  7. List all children of undetermined or unknown nationality.
  8. List all persons for which no parent is recorded.
  9. List all persons for which no children have (yet) been recorded.
  10. List the children of Frank and Mary.
  11. List all persons in the people table for which no family information is recorded in the family table.
  12. List Gina's grandparents.
  13. List Mary's grandchildren.
  14. List male parents who have a child of a different nationality
  15. List children who have parents who have different nationalities to each other
  16. List all siblings (full or half) of Paul (a sibling is a brother or sister).
  17. List full siblings of Paul (same mum AND dad)
  18. List people with the same grandparents as Gina.

Solutions

wonko@wonko.info
©Copyright 1992..2018+. Edition 26.150117
wonkosite
Creative Commons License
This work is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 2.1 Australia License
.