Sample Paper For The Exam
Sample Paper For The Exam
SAMPLE TEST1
Try this in the lab during your tutorial time, you will get a similar paper in the exam.
Student Number :
Student Name:
(Please write the query you have typed at the back of this page and submit this paper to
your examiner. If you don’t write your student no and student name your paper will not be
checked.
Use the DB at … http://www-staff.it.uts.edu.au/~raymond/db/nasa2.txt
Question 1.
List all astronauts names, year of death, and age at year of death (astroname, death, death-
birth) who died during or after 1960 and before 1970. Order by year of death. With the given
data, the result of the (correct) query will be:
Question 3.
Re-express the above natural join query as a cross product
Suggested Answers
Answer 1:
select astroname, death, death-birth
from NASA2_astronaut
where death >= 1960 and death < 1970
order by death;
Answer 2:
select distinct projectname, missionno, launchYear
from NASA2_Mission natural join NASA2_Spacecraft
where Craftname = 'Columbia' and launchYear < 1990
order by launchYear;
Answer 3:
select NASA2_Mission.projectname, NASA2_Mission.missionno, launchYear
from NASA2_Mission, NASA2_Spacecraft
where NASA2_Mission.projectname = NASA2_Spacecraft.projectname
and NASA2_Mission.missionno = NASA2_Spacecraft.missionno
and Craftname = 'Columbia' and launchYear < 1990
order by launchYear;
You don’t have to use “NASA2_Mission” in the “select” part. You could use
“NASA2_Spacecraft” instead.