Skip to content

Instantly share code, notes, and snippets.

@vingkan
Created May 1, 2019 01:29
Show Gist options
  • Save vingkan/f91f3e377459ffe6fcc1f2b160e4223d to your computer and use it in GitHub Desktop.
Save vingkan/f91f3e377459ffe6fcc1f2b160e4223d to your computer and use it in GitHub Desktop.
Solution queries for two truths and a lie with the Cook County Assessor's modeling data.
-- The only properties with 10 or more full bathrooms are apartments.
SELECT class
WHERE fbath >= 10
-- On average, properties designed from an architect's plan sold for twice as much as properties designed from a stock plan.
SELECT tp_plan, AVG(sale_price)
WHERE tp_plan IN (1, 2)
GROUP BY tp_plan
-- Most properties sold for $1 were large lots.
SELECT large_lot, COUNT(*)
WHERE sale_price = 1
GROUP BY large_lot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment