16. Let us assume that expert level courses are too demanding for
minor degree students. Find out which students have taken to demanding courses.
Give the name, number, specialily and its extent for the students and
the name and phase of the course. Order the result by student.
SELECT sLname, sFname, sNumber, spname,
sfExtent, cName, suPhase
FROM student, studying, course, speciality,
suitability, studyfor
WHERE sNumber = stStudent and stCourse = cNumber and
sNumber = sfStudent and sfExtent = 'minor' and
sfSpeciality = spId and spId = suSpeciality and
suCourse = stCourse and suPhase = 'expert'
ORDER BY sLname, sFname;
17. Teachers are paid salaries according to the hours they teach.
The sarary is paid in that month the job begings and in two succeeding
months. For each teacher, find out the factors of his/her salary on
March 2000. Give the name and number of the teacher, name of the course,
its starting time in Finnish format as BDATE, type of task and hours
allocated. Order the result by teacher and the time.
SELECT tLname, tFname, cName, tcTask, tcHours,
to_char(tcBeginDate,'DD.MM.YYYY') AS BDATE
FROM teacher, course, teaching
WHERE tId = tcTeacher and tcCourse = cNumber and
tcBeginDate between '1-JAN-2000' and '31-MAR-2000'
ORDER BY tLname, tFname, BDATE;
18. Find out the name and number of students that have started
their studies before year 1998 but have not passed any course.
SELECT sLname, sFname, sNumber
FROM student
WHERE sYearStarted < 1998 and
sNumber not in (SELECT stStudent
FROM studying
WHERE stDatePassed is not null)
ORDER BY sLname, sFname;