Skip to content
Snippets Groups Projects
Commit c7c1b37c authored by Ivy Wang's avatar Ivy Wang
Browse files

merge

parent 47b8505c
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@ def string_to_int(s):
def update_korea():
conn = sqlite3.connect('prototype_db')
c = conn.cursor()
korea_code = get_country_code("Korea, Republic of", c)
korea_src_url = "http://ncov.mohw.go.kr/index.jsp"
korea_src = get_source_id(korea_src_url, c)
......
......@@ -80,9 +80,9 @@ CREATE TABLE Cases_Per_District(
-- keeps track of vaccinations per Country
CREATE TABLE Vaccinations_Per_Country(
first_vaccination_number BIGINT NOT NULL,
second_vaccination_number BIGINT NOT NULL,
third_vaccination_number BIGINT NOT NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
country_code VARCHAR(2) ,
source_id BIGINT NOT NULL,
FOREIGN KEY (country_code) REFERENCES Countries(country_code),
......@@ -91,9 +91,9 @@ CREATE TABLE Vaccinations_Per_Country(
-- keeps track of vaccinations per Region
CREATE TABLE Vaccinations_Per_Region(
first_vaccination_number BIGINT NOT NULL,
second_vaccination_number BIGINT NOT NULL,
third_vaccination_number BIGINT NOT NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
region_code BIGINT,
source_id BIGINT NOT NULL,
FOREIGN KEY (region_code) REFERENCES Regions(region_code),
......@@ -102,9 +102,9 @@ CREATE TABLE Vaccinations_Per_Region(
-- keeps track of vaccinations per District
CREATE TABLE Vaccinations_Per_District(
first_vaccination_number BIGINT NOT NULL,
second_vaccination_number BIGINT NOT NULL,
third_vaccination_number BIGINT NOT NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
district_code BIGINT,
source_id BIGINT NOT NULL,
FOREIGN KEY (district_code) REFERENCES Districts(district_code),
......@@ -160,10 +160,10 @@ CREATE TABLE Age_Per_Country(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate INT NULL,
recovery_rate INT NULL,
hospitalization_rate INT NULL,
death_rate INT NULL,
case_rate FLOAT NULL,
recovery_rate FLOAT NULL,
hospitalization_rate FLOAT NULL,
death_rate FLOAT NULL,
FOREIGN KEY (country_id) REFERENCES Countries(country_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
......@@ -178,10 +178,10 @@ CREATE TABLE Age_Per_Region(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate INT NULL,
recovery_rate INT NULL,
hospitalization_rate INT NULL,
death_rate INT NULL,
case_rate FLOAT NULL,
recovery_rate FLOAT NULL,
hospitalization_rate FLOAT NULL,
death_rate FLOAT NULL,
FOREIGN KEY (region_id) REFERENCES Regions(region_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
......@@ -196,10 +196,10 @@ CREATE TABLE Age_Per_District(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate INT NULL,
recovery_rate INT NULL,
hospitalization_rate INT NULL,
death_rate INT NULL,
case_rate FLOAT NULL,
recovery_rate FLOAT NULL,
hospitalization_rate FLOAT NULL,
death_rate FLOAT NULL,
FOREIGN KEY (district_id) REFERENCES Districts(district_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
......
......@@ -84,9 +84,9 @@ c.execute('''
c.execute('''
CREATE TABLE Vaccinations_Per_Country(
date_collected DATETIME2 NOT NULL,
first_vaccination_number BIGINT NOT NULL,
second_vaccination_number BIGINT NOT NULL,
third_vaccination_number BIGINT NOT NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
country_code VARCHAR(2),
source_id BIGINT NOT NULL,
FOREIGN KEY (country_code) REFERENCES Countries(country_code),
......@@ -97,9 +97,9 @@ c.execute('''
c.execute('''
CREATE TABLE Vaccinations_Per_Region(
date_collected DATETIME2 NOT NULL,
first_vaccination_number BIGINT NOT NULL,
second_vaccination_number BIGINT NOT NULL,
third_vaccination_number BIGINT NOT NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
region_code BIGINT,
source_id BIGINT NOT NULL,
FOREIGN KEY (region_code) REFERENCES Regions(region_code),
......@@ -110,9 +110,9 @@ c.execute('''
c.execute('''
CREATE TABLE Vaccinations_Per_District(
date_collected DATETIME2 NOT NULL,
first_vaccination_number BIGINT NOT NULL,
second_vaccination_number BIGINT NOT NULL,
third_vaccination_number BIGINT NOT NULL,
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
district_code BIGINT,
source_id BIGINT NOT NULL,
FOREIGN KEY (district_code) REFERENCES Districts(district_code),
......@@ -153,10 +153,10 @@ c.execute('''CREATE TABLE Age_Per_Country(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate INT NULL,
recovery_rate INT NULL,
hospitalization_rate INT NULL,
death_rate INT NULL,
case_rate FLOAT NULL,
recovery_rate FLOAT NULL,
hospitalization_rate FLOAT NULL,
death_rate FLOAT NULL,
FOREIGN KEY (country_id) REFERENCES Countries(country_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
......@@ -171,10 +171,10 @@ c.execute('''CREATE TABLE Age_Per_Region(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate INT NULL,
recovery_rate INT NULL,
hospitalization_rate INT NULL,
death_rate INT NULL,
case_rate FLOAT NULL,
recovery_rate FLOAT NULL,
hospitalization_rate FLOAT NULL,
death_rate FLOAT NULL,
FOREIGN KEY (region_id) REFERENCES Regions(region_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
......@@ -190,10 +190,10 @@ c.execute('''CREATE TABLE Age_Per_District(
recovery_number INT NULL,
hospitalization_number INT NULL,
death_number INT NULL,
case_rate INT NULL,
recovery_rate INT NULL,
hospitalization_rate INT NULL,
death_rate INT NULL,
case_rate FLOAT NULL,
recovery_rate FLOAT NULL,
hospitalization_rate FLOAT NULL,
death_rate FLOAT NULL,
FOREIGN KEY (district_id) REFERENCES Districts(district_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment