COMP3311 Final Exam 20T3 The University of New South Wales
COMP3311 Database Systems
Final Exam 20T3
Database Systems
[Front Page] [Notes] [Database] [Course Website] [Cheat Sheets]
[Q1] [Q2] [Q3] [Q4] [Q5] [Q6] [Q7] [Q8] [Q9] [Q10] [Q11] [Q12]

Question 3 (7 marks)

Write an SQL view that gives a list performers who play many instruments, and how many instruments they play. "Many" is defined as more than half of the possible instruments. The possible instruments can be determined by looking at the instrument column in the PlaysOn table. However we impose the following conditions:

If you handle the above conditions correctly there are 12 distinct instruments ('banjo', 'bass', 'drums', 'flute', 'guitar', 'keyboard', 'mandolin', 'percussion', 'saxophone', 'synthesizer', 'tambourine', 'violin') in the current database. However, you should not assume that this will always be the case (i.e. you should compute the number of instruments). Answers that assume that there are 12 instruments (e.g. explicitly use the number 12 or 6) are worth a maximum of half marks.

Define the view as q3(performer,ninstruments), where the attributes are:

Instructions:

End of Question