Skip to content
This repository has been archived by the owner on May 21, 2020. It is now read-only.

Class 2.3 – LOE cleaning

Brendan Younger edited this page Jul 16, 2016 · 1 revision

For loe_all_cases, fix: date fields, shift ownername2 and ownermailaddr, use nullif() on fields, and create table as select. Add a primary key for casenumber.

We do: do same for case history table.

Demonstrate join on all_cases to case_history. Show count() of entries in case_history. Then, avg() # of entries per case.

Join to all_inspections and notice count difference. Do a left join. Filter with where exists.

Do a double join on case_history and all_violations. Show duplicated rows.

Misc ideas: Distinct on casetype, inspector, and closereason. Point out bad formatting for casenotes. Re-do full address with concat_ws.