Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
COVID-19-Data-Integration
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ivy Wang
COVID-19-Data-Integration
Commits
a143902b
Commit
a143902b
authored
3 years ago
by
Arshana Jain
Browse files
Options
Downloads
Patches
Plain Diff
updated country code to VARCHAR(3)
parent
de52ec67
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
country_countryCode.csv
+1
-1
1 addition, 1 deletion
country_countryCode.csv
data/OverallSchema.sql
+7
-7
7 additions, 7 deletions
data/OverallSchema.sql
prototype_main_backend.py
+6
-6
6 additions, 6 deletions
prototype_main_backend.py
with
14 additions
and
14 deletions
country_countryCode.csv
+
1
−
1
View file @
a143902b
...
...
@@ -154,7 +154,7 @@ Montserrat,MS
Morocco,MA
Mozambique,MZ
Myanmar,MM
Namibia,NA
Namibia,NA
!
Nauru,NR
Nepal,NP
Netherlands,NL
...
...
This diff is collapsed.
Click to expand it.
data/OverallSchema.sql
+
7
−
7
View file @
a143902b
...
...
@@ -2,7 +2,7 @@
-- no nulls
-- country codes are used in the rest of the tables as keys
CREATE
TABLE
Countries
(
country_code
VARCHAR
(
2
)
PRIMARY
KEY
,
country_code
VARCHAR
(
3
)
PRIMARY
KEY
,
country_name
VARCHAR
(
128
)
UNIQUE
NOT
NULL
);
...
...
@@ -11,7 +11,7 @@ CREATE TABLE Countries(
CREATE
TABLE
Regions
(
region_code
BIGINT
IDENTITY
(
1
,
1
)
PRIMARY
KEY
,
region_name
VARCHAR
(
128
)
NOT
NULL
,
country_code
VARCHAR
(
2
)
NOT
NULL
,
country_code
VARCHAR
(
3
)
NOT
NULL
,
longitude
FLOAT
NULL
,
latitude
FLOAT
NULL
,
FOREIGN
KEY
(
country_code
)
REFERENCES
Countries
(
country_code
)
...
...
@@ -39,7 +39,7 @@ CREATE TABLE Sources(
-- information on cases, recovery numbers, and deaths
-- per countries
CREATE
TABLE
Cases_Per_Country
(
country_code
VARCHAR
(
2
),
country_code
VARCHAR
(
3
),
date_collected
DATETIME2
NOT
NULL
,
source_id
BIGINT
NOT
NULL
,
death_numbers
INT
NULL
,
...
...
@@ -83,7 +83,7 @@ CREATE TABLE Vaccinations_Per_Country(
first_vaccination_number
BIGINT
NULL
,
second_vaccination_number
BIGINT
NULL
,
third_vaccination_number
BIGINT
NULL
,
country_code
VARCHAR
(
2
)
,
country_code
VARCHAR
(
3
)
,
source_id
BIGINT
NOT
NULL
,
FOREIGN
KEY
(
country_code
)
REFERENCES
Countries
(
country_code
),
FOREIGN
KEY
(
source_id
)
REFERENCES
Sources
(
source_id
)
...
...
@@ -113,7 +113,7 @@ CREATE TABLE Vaccinations_Per_District(
-- keeps track of strain data per country
CREATE
TABLE
Strains_Per_Country
(
country_code
VARCHAR
(
2
)
PRIMARY
KEY
,
country_code
VARCHAR
(
3
)
PRIMARY
KEY
,
source_id
BIGINT
NOT
NULL
,
alpha_rate
INT
NULL
,
beta_rate
INT
NULL
,
...
...
@@ -153,7 +153,7 @@ CREATE TABLE Strains_Per_District(
-- age related data on covid per country
CREATE
TABLE
Age_Per_Country
(
date_collected
DATETIME2
NOT
NULL
,
country_code
VARCHAR
(
2
),
country_code
VARCHAR
(
3
),
source_id
BIGINT
NOT
NULL
,
age_group
VARCHAR
(
64
)
NOT
NULL
,
case_number
INT
NULL
,
...
...
@@ -206,7 +206,7 @@ CREATE TABLE Age_Per_District(
-- population per country on a given date
CREATE
TABLE
Population_Per_Country
(
country_code
VARCHAR
(
2
)
PRIMARY
KEY
,
country_code
VARCHAR
(
3
)
PRIMARY
KEY
,
population_amount
BIGINT
NOT
NULL
,
date_collected
DATETIME2
NOT
NULL
,
FOREIGN
KEY
(
country_code
)
REFERENCES
Countries
(
country_code
)
...
...
This diff is collapsed.
Click to expand it.
prototype_main_backend.py
+
6
−
6
View file @
a143902b
...
...
@@ -7,7 +7,7 @@ c = conn.cursor()
# TODO Namibia's country code is currently being read as NULL; wait for SQLServer and then debug
c
.
execute
(
'''
CREATE TABLE Countries(
country_code VARCHAR(
2
) PRIMARY KEY,
country_code VARCHAR(
3
) PRIMARY KEY,
country_name VARCHAR(128) UNIQUE NOT NULL
)
'''
)
...
...
@@ -15,7 +15,7 @@ c.execute('''
CREATE TABLE Regions(
region_code INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
region_name VARCHAR(128) NOT NULL,
country_code VARCHAR(
2
) NOT NULL,
country_code VARCHAR(
3
) NOT NULL,
longitude FLOAT NULL,
latitude FLOAT NULL,
FOREIGN KEY (country_code) REFERENCES Countries(country_code)
...
...
@@ -42,7 +42,7 @@ c.execute('''
c
.
execute
(
'''
CREATE TABLE Cases_Per_Country(
country_code VARCHAR(
2
) ,
country_code VARCHAR(
3
) ,
date_collected DATETIME2 NOT NULL,
source_id BIGINT NOT NULL,
death_numbers INT NULL,
...
...
@@ -88,7 +88,7 @@ c.execute('''
first_vaccination_number BIGINT NULL,
second_vaccination_number BIGINT NULL,
third_vaccination_number BIGINT NULL,
country_code VARCHAR(
2
),
country_code VARCHAR(
3
),
source_id BIGINT NOT NULL,
FOREIGN KEY (country_code) REFERENCES Countries(country_code),
FOREIGN KEY (source_id) REFERENCES Sources(source_id)
...
...
@@ -122,7 +122,7 @@ c.execute('''
'''
)
c
.
execute
(
'''
CREATE TABLE Population_Per_Country(
country_code VARCHAR(
2
) PRIMARY KEY,
country_code VARCHAR(
3
) PRIMARY KEY,
population_amount BIGINT NOT NULL,
date_collected DATETIME2 NOT NULL,
FOREIGN KEY (country_code) REFERENCES Countries(country_code)
...
...
@@ -147,7 +147,7 @@ c.execute('''CREATE TABLE Population_Per_District(
c
.
execute
(
'''
CREATE TABLE Age_Per_Country(
date_collected DATETIME2 NOT NULL,
country_id VARCHAR(
2
),
country_id VARCHAR(
3
),
source_id BIGINT NOT NULL,
age_group VARCHAR(64) NOT NULL,
case_number INT NULL,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment