-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTABLE_CLEANING.sql
More file actions
22 lines (16 loc) · 952 Bytes
/
Copy pathTABLE_CLEANING.sql
File metadata and controls
22 lines (16 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use road_trauma;
SELECT count(*) FROM national_monthly_facts;
SELECT * FROM national_monthly_facts;
SELECT count(*) FROM national_monthly_facts
WHERE count_of_cases IS NULL;
SELECT count(*) FROM national_monthly_facts
WHERE calendar_year IS NULL;
SELECT calendar_year, month, remoteness_area, cause_of_injury, age_group, sex, road_user, counterparty, count_of_cases, bed_days, died_cases, died_bed_days, hospitalisations from national_monthly_facts
group by calendar_year, month, remoteness_area, cause_of_injury, age_group, sex, road_user, counterparty, count_of_cases, bed_days, died_cases, died_bed_days, hospitalisations
having count(*) >1;
select count(*) from national_monthly_facts
where hospitalisations = 0 and bed_days = 0 and month = "";
select * from national_monthly_facts
where hospitalisations = 0 and bed_days = 0 and month = "";
DELETE from national_monthly_facts
where hospitalisations = 0 and bed_days = 0 and month = "";