-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema2.sql
45 lines (40 loc) · 885 Bytes
/
schema2.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--Create PHU_locations-------------------------------------
CREATE TABLE PHU_locations (
id INT,
PHU_id INT,
Reporting_PHU VARCHAR,
Reporting_PHU_Address VARCHAR,
Reporting_PHU_Latitude FLOAT,
Reporting_PHU_Longitude FLOAT,
PRIMARY KEY(PHU_id)
);
--Create PHU table
CREATE TABLE PHU (
id INT,
age_group VARCHAR,
gender VARCHAR,
outcome VARCHAR,
outbreak VARCHAR,
phu_id INT,
week INT,
month INT,
year INT,
PRIMARY KEY (id),
FOREIGN KEY (phu_id) REFERENCES PHU_locations (PHU_id)
);
--Create PHU_Gender_Final table
CREATE TABLE PHU_Gender_Final (
index INT,
phu_id INT,
gender VARCHAR,
gender_count INT,
FOREIGN KEY (phu_id) REFERENCES PHU_locations (PHU_id)
);
--Create PHU_Age_Group_Final table
CREATE TABLE PHU_Age_Group_Final (
index INT,
phu_id INT,
age_group VARCHAR,
age_group_count INT,
FOREIGN KEY (phu_id) REFERENCES PHU_locations (PHU_id)
);