Copyright © T. H. Merrett

COMP 612              Principles of Database Programming                  Week 6

				   Assignment 5

a) (40/50) Use relix to answer the following query.

Find the youngest decile of cars in the CARS relation, and create a relation
containing each of the years of registration of this top 10% of the cars, and,
for each year, the number of cars registered in that year. Also have a tuple
for the total number of remaining cars.

Decile = a portion consisting of 10% of the whole. Youngest decile of 10,000
cars = the youngest 1000 cars. But do not assume you know how many cars there
are in CARS.

ALL RELIX ASSIGNMENTS ARE TO BE SUBMITTED IN THE FORM OF AN UNEDITED TRACE
OF YOUR DEBUGGED FINAL RUN.

b) (10/50) (You do not need to run this part on relix.) Using only the natural
join and the domain algebra, write an expression which is equivalent to
				R sup S
for relations R(A,B) and S(B,C).


Shared marks for shared work: assignments should be your own work; marks
for joint assignments will be divided by the number of collaborators.
But please feel free to work in groups to learn or for extra work that
is not for marks. HINT: treat your own work for marks as top secret; treat
others' work, if you come across it, as personal and private to them.