COMP3311 Final Exam 20T3 |
The University of New South Wales COMP3311 Database Systems Final Exam 20T3 |
Database Systems |
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: