| COMP3311 26T2 |
Assignment 2 Example Test Cases |
Database Systems |
[Assignment Spec] [Database Design] [Examples] [Testing] [Submitting]
The following will give some sample inputs and outputs that you can use to estimate the correctness of your views and functions.
These examples are by no means exhaustive, and more cases will be used in the auto-marking; it is up to you to perform comprehensive checking of your solution.
# Show some useful info on the database $ python3 q1.py Top 10 most expensive houses Bellevue Hill $10384593 Bellevue Hill $10268604 Bellevue Hill $10224761 Bellevue Hill $10199771 Bellevue Hill $10054824 (sold) Darling Point $9939934 Bellevue Hill $9917429 Bellevue Hill $9889812 Darling Point $9796895 Bellevue Hill $9670130 Top 10 most expensive apartments Barangaroo $4483540 Barangaroo $4469489 Barangaroo $4445379 (sold) Barangaroo $4417866 Bayview $4335339 Barangaroo $4332448 Bayview $4328655 Bayview $4319163 Barangaroo $4311673 Bayview $4241267 Top 10 suburbs by median house price Bellevue Hill $9687500 Darling Point $9125000 Centennial Park $8500000 Double Bay $7850000 Vaucluse $7500000 Dover Heights $6850000 Milsons Point $6800000 Longueville $5922500 Bronte $5750000 Mosman $5617500 Top 10 suburbs by median apartment price Barangaroo $3900000 Bayview $3650000 Castle Cove $2900000 Milsons Point $2625000 Balgowlah Heights $2560000 Darling Point $2350000 Cremorne Point $2347500 North Wahroonga $2100000 Cabarita $2090000 Double Bay $2062500 Suburbs with median house price less than median apartment price Bayview H $3225000 A $3650000 Miller H $855000 A $860000 Wentworth Point H $737000 A $748000 # List the LGAs, including merged LGAs $ python3 q2.py Bayside Council created in 2016 from the merger of Borough of Botany Bay (1888) Rockdale Municipality (1871) Blacktown City Council created in 1906 Camden Council created in 1889 City of Blue Mountains created in 1889 City of Campbelltown created in 1882 City of Canada Bay created in 2000 City of Canterbury-Bankstown created in 2016 from the merger of Municipal District of Bankstown (1895) Municipal District of Canterbury (1879) City of Hawkesbury created in 1843 City of Liverpool created in 1872 City of Parramatta created in 1861 City of Penrith created in 1871 City of Randwick created in 1859 City of Ryde created in 1870 City of Sydney created in 1842 City of Willoughby created in 1865 Cumberland City Council created in 1872 Fairfield City Council created in 1888 Georges River Council created in 2016 from the merger of Kogarah Municipality (1885) Municipal District of Hurstville (1887) Hornsby Shire created in 1906 Inner West Council created in 2016 from the merger of Borough of Ashfield (1871) Municipal District of Leichhardt (1871) Municipality of Marrickville (1861) Ku-ring-gai Council created in 1906 Lane Cove Council created in 1895 Mosman Council created in 1893 Municipality of Burwood created in 1874 Municipality of Hunter's Hill created in 1861 Municipality of Strathfield created in 1885 Municipality of Woollahra created in 1860 North Sydney Council created in 1893 Northern Beaches Council created in 2016 from the merger of Manly Municipality (1877) Pittwater Municipality (1992) Warringah Shire (1906) Sutherland Shire created in 1906 The Hills Shire created in 1906 Waverley Council created in 1859 Wollondilly Shire created in 1906 $ python3 q2.py Waverley Invalid LGA name: Waverley # must supply full name of LGA $ python3 q2.py 'waverley council' Invalid LGA name: waverley council # uses case-sensitive matching $ python3 q2.py 'Waverley Council' Waverley Council founded in 1859 Bondi Bondi Beach Bondi Junction Bronte Dover Heights North Bondi Queens Park Rose Bay Tamarama Vaucluse Waverley $ python3 q2.py 'Bayside Council' Bayside Council founded in 2016 Arncliffe Banksia Bardwell Park Bardwell Valley Bexley Bexley North Botany Brighton-Le-Sands Daceyville Dolls Point Eastgardens Eastlakes Hillsdale Mascot Monterey Pagewood Ramsgate Ramsgate Beach Rockdale Rosebery Sandringham Turrella Wolli Creek $ python3 ./q2.py 'Rockdale Municipality' Rockdale Municipality founded in 1871 $ # Note that Rockdale Municipality is a valid LGA but has # been merged into Bayside Council so has no constituent suburbs # List all properties sold in a specified region $ python3 q3.py Usage: q3.py (inner|greater|outer) $ python3 q3.py inner Abbotsford house: 3beds, 2baths, 1car, $3955629, Sold on 2026-04-14 house: 3beds, 1bath, 2cars, $3585521, Sold on 2026-04-22 Alexandria house: 4beds, 2baths, 2cars, $2666560, Sold on 2026-02-26 house: 4beds, 2baths, 1car, $2947706, Sold on 2026-02-27 house: 3beds, 1bath, 1car, $2495662, Sold on 2026-03-20 house: 3beds, 2baths, 1car, $2644300, Sold on 2026-04-12 apartment: 2beds, 1bath, 0cars, $1205507, Sold on 2026-03-08 Annandale house: 2beds, 1bath, 2cars, $2604159, Sold on 2026-03-17 apartment: 3beds, 1bath, 1car, $1416751, Sold on 2026-02-22 apartment: 2beds, 2baths, 1car, $1338148, Sold on 2026-02-25 apartment: 3beds, 1bath, 0cars, $1484099, Sold on 2026-04-06 apartment: 2beds, 1bath, 0cars, $1320105, Sold on 2026-04-09 apartment: 2beds, 1bath, 0cars, $1297393, Sold on 2026-04-11 Arncliffe house: 4beds, 1bath, 1car, $2352127, Sold on 2026-02-08 house: 2beds, 1bath, 2cars, $2211180, Sold on 2026-04-21 house: 2beds, 2baths, 1car, $1988338, Sold on 2026-04-26 apartment: 2beds, 1bath, 1car, $1178562, Sold on 2026-04-04 apartment: 2beds, 1bath, 1car, $1196032, Sold on 2026-04-28 ... LOTS MORE, omitted to save space ... Waverley house: 4beds, 1bath, 1car, $4412497, Sold on 2026-02-14 house: 3beds, 2baths, 2cars, $4275156, Sold on 2026-03-24 house: 2beds, 2baths, 1car, $4048868, Sold on 2026-04-02 apartment: 3beds, 2baths, 0cars, $2277209, Sold on 2026-02-21 apartment: 3beds, 1bath, 0cars, $2164473, Sold on 2026-02-25 apartment: 2beds, 2baths, 0cars, $2106135, Sold on 2026-03-08 apartment: 3beds, 2baths, 1car, $2082074, Sold on 2026-03-26 apartment: 1bed, 1bath, 1car, $1748323, Sold on 2026-04-13 Waverton house: 2beds, 2baths, 1car, $4110646, Sold on 2026-02-13 house: 4beds, 2baths, 1car, $4640356, Sold on 2026-03-21 Wolli Creek house: 3beds, 2baths, 2cars, $1941241, Sold on 2026-02-20 apartment: 3beds, 2baths, 1car, $1411217, Sold on 2026-03-12 Woollahra house: 2beds, 2baths, 1car, $4437342, Sold on 2026-03-21 apartment: 3beds, 2baths, 0cars, $1928435, Sold on 2026-02-07 apartment: 2beds, 2baths, 0cars, $1592618, Sold on 2026-02-15 apartment: 2beds, 1bath, 0cars, $1593307, Sold on 2026-04-20 Woolwich house: 2beds, 2baths, 2cars, $2354910, Sold on 2026-03-06 apartment: 3beds, 1bath, 0cars, $1367835, Sold on 2026-02-15 apartment: 1bed, 2baths, 1car, $999162, Sold on 2026-03-12 Zetland house: 4beds, 1bath, 2cars, $3072837, Sold on 2026-03-14 apartment: 3beds, 1bath, 1car, $1598940, Sold on 2026-02-20 apartment: 2beds, 1bath, 0cars, $1317866, Sold on 2026-04-12 apartment: 3beds, 1bath, 0cars, $1509619, Sold on 2026-04-17 $ python3 q3.py outer Bligh Park house: 5beds, 2baths, 3cars, $2033035, Sold on 2026-02-18 house: 6beds, 4baths, 1car, $2304123, Sold on 2026-02-20 house: 5beds, 3baths, 2cars, $1924730, Sold on 2026-03-08 East Kurrajong house: 4beds, 2baths, 3cars, $2564718, Sold on 2026-03-05 house: 3beds, 2baths, 1car, $2459589, Sold on 2026-03-15 house: 5beds, 2baths, 3cars, $2944666, Sold on 2026-04-21 McGraths Hill house: 4beds, 4baths, 1car, $1885880, Sold on 2026-02-17 North Richmond house: 5beds, 2baths, 3cars, $1960413, Sold on 2026-02-22 house: 3beds, 3baths, 2cars, $1550108, Sold on 2026-02-25 house: 3beds, 3baths, 1car, $1705497, Sold on 2026-03-15 Oakville house: 4beds, 2baths, 2cars, $1941959, Sold on 2026-04-01 Pitt Town house: 6beds, 2baths, 1car, $3210117, Sold on 2026-02-16 house: 6beds, 4baths, 1car, $2979069, Sold on 2026-03-24 house: 4beds, 4baths, 1car, $2822895, Sold on 2026-04-20 Richmond house: 6beds, 2baths, 1car, $2089415, Sold on 2026-02-09 apartment: 3beds, 2baths, 2cars, $1193283, Sold on 2026-02-03 apartment: 3beds, 2baths, 1car, $1167194, Sold on 2026-04-04 South Windsor house: 5beds, 4baths, 1car, $2038495, Sold on 2026-02-09 house: 5beds, 2baths, 3cars, $1843762, Sold on 2026-03-20 house: 3beds, 3baths, 2cars, $1601282, Sold on 2026-03-25 house: 4beds, 2baths, 3cars, $1722811, Sold on 2026-04-07 house: 6beds, 2baths, 1car, $2053933, Sold on 2026-04-14 Windsor house: 5beds, 2baths, 3cars, $1972402, Sold on 2026-02-25 house: 3beds, 2baths, 2cars, $1580090, Sold on 2026-03-08 # Search for unsold properties in/near a specified suburb # and satisfying certain criteria e.g. #bedrooms, #bathrooms, ... $ python3 q4.py Usage: q4.py PropType (in|near) Suburb [M bed[s]] [N bath[s]] [P car[s]] $ python3 q4.py hotel in randwick Invalid property type $ python3 q4.py house between the rocks Location must be "in" or "near" $ python3 q4.py apartment in 'castle crag' No such suburb: Castle Crag # note that all words in suburb names are capitalised $ python3 q4.py apartment in randwick 0 beds 1 bath Cannot have zero bedrooms $ python3 q4.py apartment in randwick 1 bed 0 bath Cannot have zero bathrooms $ python3 q4.py house in Randwick Houses in Randwick 2beds, 1bath, 2cars, $3304496 2beds, 1bath, 1car, $3456662 3beds, 2baths, 2cars, $3520609 3beds, 2baths, 1car, $3571840 2beds, 1bath, 1car, $3718550 4beds, 2baths, 1car, $3743264 3beds, 2baths, 1car, $3759904 2beds, 1bath, 2cars, $3762153 3beds, 2baths, 1car, $3783644 2beds, 2baths, 2cars, $3803056 2beds, 1bath, 1car, $3811516 2beds, 1bath, 2cars, $3874533 4beds, 1bath, 1car, $3888569 4beds, 1bath, 2cars, $4086637 4beds, 2baths, 1car, $4249849 $ python3 q4.py a in rosemeadow Apartments in Rosemeadow 2beds, 1bath, 1car, $1069307 2beds, 1bath, 1car, $1072524 2beds, 2baths, 1car, $1195397 3beds, 2baths, 1car, $1355908 $ python3 q4.py apartment in berowra No suitable apartments in Berowra # explictly asking for apartments with no car spaces $ python3 q4.py apartment near 'randwick' 3 beds 2 baths 0 cars Apartments in Randwick 3beds, 2baths, 0cars, $1745730 3beds, 2baths, 0cars, $1831520 Apartments in Bondi Junction 3beds, 2baths, 0cars, $1800106 Apartments in Centennial Park 3beds, 2baths, 0cars, $1418573 3beds, 2baths, 0cars, $1461023 3beds, 2baths, 0cars, $1573046 Apartments in Clovelly 3beds, 2baths, 0cars, $2470423 Apartments in Coogee 3beds, 2baths, 0cars, $1965896 3beds, 2baths, 0cars, $1981884 3beds, 2baths, 0cars, $2051379 3beds, 2baths, 0cars, $2062462 Apartments in Kensington 3beds, 2baths, 0cars, $1549894 Apartments in Kingsford 3beds, 2baths, 0cars, $1505617 3beds, 2baths, 0cars, $1526978 Apartments in Queens Park 3beds, 2baths, 0cars, $1953385 3beds, 2baths, 0cars, $1963685 3beds, 2baths, 0cars, $2137077 Apartments in Waverley 3beds, 2baths, 0cars, $2165146 # asking for apartments with 1 or more car spaces $ python3 q4.py apartment near 'randwick' 3 beds 2 baths 1 cars Apartments in Randwick 3beds, 2baths, 1car, $1716102 3beds, 2baths, 1car, $1749172 3beds, 2baths, 1car, $1839294 Apartments in Bondi Junction 3beds, 2baths, 1car, $1836867 3beds, 2baths, 1car, $1857157 Apartments in Centennial Park 3beds, 2baths, 1car, $1504948 3beds, 2baths, 1car, $1518026 3beds, 2baths, 1car, $1518119 3beds, 2baths, 1car, $1527196 3beds, 2baths, 1car, $1544975 Apartments in Clovelly 3beds, 2baths, 1car, $2240070 3beds, 2baths, 1car, $2291746 3beds, 2baths, 1car, $2369179 3beds, 2baths, 1car, $2512737 Apartments in Coogee 3beds, 2baths, 1car, $1841421 3beds, 2baths, 1car, $1878142 3beds, 2baths, 1car, $1944900 3beds, 2baths, 1car, $1961116 3beds, 2baths, 1car, $2067410 3beds, 2baths, 1car, $2107261 3beds, 2baths, 1car, $2119076 Apartments in Kensington 3beds, 2baths, 1car, $1536899 3beds, 2baths, 1car, $1608668 Apartments in Kingsford 3beds, 2baths, 1car, $1550238 Apartments in Queens Park 3beds, 2baths, 1car, $2007069 3beds, 2baths, 1car, $2099857 3beds, 2baths, 1car, $2123760 Apartments in Waverley 3beds, 2baths, 1car, $2316935 # asking for apartments with 2 or more car spaces # could have inferred this from previous query; no apartments had more than 1 car space $ python3 q4.py apartment near 'randwick' 3 beds 2 baths 2 cars No suitable apartments in Randwick No suitable apartments in Bondi Junction No suitable apartments in Centennial Park No suitable apartments in Clovelly No suitable apartments in Coogee No suitable apartments in Kensington No suitable apartments in Kingsford No suitable apartments in Queens Park No suitable apartments in Waverley ... more examples to come ...