-
Notifications
You must be signed in to change notification settings - Fork 0
/
sql_queries_script.py
49 lines (38 loc) · 1.12 KB
/
sql_queries_script.py
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
45
46
47
48
49
# drop tables
killers_bio_drop = "DROP TABLE IF EXISTS killers_bio"
killers_additional_details_drop = "DROP TABLE IF EXISTS killers_additional_details"
# creating tables
killers_bio_create = ("""
CREATE TABLE IF NOT EXISTS killers_bio
(
KillerID int PRIMARY KEY,
YearBorn int,
Race text,
Sex text
)
""")
killers_additional_create = ("""
CREATE TABLE IF NOT EXISTS killers_additional_details
(
KillerID int PRIMARY KEY,
AgeFirstKill int,
AgeLastKill int,
Motive text,
Sentence text,
InsanityPlea text
)
""")
# inserting records
killers_bio_table_insert = ("""
INSERT INTO killers_bio
(KillerID, YearBorn, Race, Sex)
VALUES (%s, %s, %s, %s);
""")
killers_additional_table_insert = ("""
INSERT INTO killers_additional_details
(KillerID, AgeFirstKill, AgeLastKill, Motive, Sentence,InsanityPlea)
VALUES (%s, %s, %s, %s, %s, %s);
""")
# create and drop tables
create_table_queries = [killers_bio_create, killers_additional_create]
drop_table_queries = [killers_bio_drop, killers_additional_details_drop]