Professional Documents
Culture Documents
(c) You must use JOINs (either implicit or explicit syntax) in A2. Do not use
subqueries in A2. There will be a one point deduction per violation.
Joins
1. List the courses for the program code ‘0066C’. Include the school code, Program, 4
program code, course number and semester in the result. Order the ProgramCourse
result by the semester and course number.
course code
2. List the required course prerequisites for COMP2280. Include the course Course, 4
code, prereq and prereq course names in the result. Order the result by CoursePrerequisiteAnd
the prerequisite course code in descending order. Use the implicit join
syntax.
3. List the persons from the Person table who are not students. Show the Person, 5
person’s number, first name, last name, and city. Use LEFT OUTER JOIN. Student
Order the results by the person’s last name.
Number of rows expected: 14
4. List the lab software installed on machines in room 2A205. List each LabSoftware, 5
software package’s unique identifier along with the software product’s Room,
name. Order the result by software product name. Use the explicit join Software
syntax.
Number of rows expected: 20
Aggregate Functions
6. Show CourseOffering courseNumber, CourseStudent minimum CourseOffering, 6
finalMark aliased as ‘Lowest Mark’, CourseStudent average finalMark CourseStudent
aliased as ‘Average Mark’ and CourseStudent maximum finalMark
aliased as ‘Highest Mark’ for the Winter 2010 session grouped by
courseNumber. Report all grades as whole numbers.
7. List the number of courses taught by employees in the School of Person, Employee, 7
Engineering and IT (EIT), for those courses offered in any semester of CourseOffering
2008 or 2009. Include in the result the employee number, “user id” in
caps (i.e., first three letters of last name and last 3 characters of
employee number), along with the count of the number of courses that
they taught, aliased with “# Courses Taught”. Order the result by “user
id”. Use only inner joins (explicit syntax).
8. Produce a list of all of the co-op programs and the total tuition for those Program, 7
programs over all semesters. As these amounts are for co-op programs, ProgramFee
the base tuition amount must be increased by the corresponding co-op
multiplier for each specific program. Output the program acronym and
program name in the result, along with the total tuition (i.e., Total Fees).
Use FORMAT() to display the Total Fees in dollars and cents.
50