[prev] 7 [next]

Exercise 1: SQL (revision)

Given the following schema:

Students(sid, name, degree, ...)
e.g. Students(3322111, 'John Smith', 'MEngSc', ...)
Courses(cid, code, term, title, ...)
e.g. Courses(1732, 'COMP9311', '12s1', 'Databases', ...)
Enrolments(sid, cid, mark, grade)
e.g. Enrolments(3322111, 1732, 50, 'PS')

Write an SQL query to solve the problem

  • find all students who passed COMP9315 in 16s1
  • for each student, give (student ID, name, mark)