Question 1 (4 marks)
Write an SQL view that gives information about the
album(s) with the longest total running time (sum of length
of songs on the album).
Define the view as q1("group",album,year),
where the attributes are:
- "group" = the name of the group
- album = the title of the album
- year = the year the album was released
Note that the attribute name "group" must appear in
double-quotes because it's an SQL reserved word.
Instructions:
- Work on this question in the work/q1/ directory
- Define the q1 view in the q1.sql file
- Also, place any additional views used by q1 in this file
- Additional views must be placed before the q1 definition
- You may not define your own functions to help in answering this question
- Load it into your database using: psql music -f q1.sql
- Sample output is in the file: tests/01.expected
- Test it via: select * from q1 order by "group";
- Check it using: sh check q1 in the q1 directory
- Submit it using: give cs3311 exam_q1 q1.sql or Webcms3