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

Question 1 (4 marks)

Write an SQL view that gives information about the most recently sold properties.

Define the view as q1(date,price,type), where the attributes are:

Note that while date and type are SQL keywords, it is safe to use them without double-quotes.

The output should be ordered by price. What the output should look like:

property=# select * from q1;
    date    |  price  |   type    
------------+---------+-----------
 2021-11-09 | 1816000 | Townhouse
 2021-11-09 | 1859000 | Townhouse
 2021-11-09 | 2154000 | House
 2021-11-09 | 2230000 | House
 2021-11-09 | 2665000 | House
 2021-11-09 | 2833000 | House
 2021-11-09 | 2836000 | House
(7 rows)

Instructions:

End of Question