-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueries.py
52 lines (48 loc) · 1.01 KB
/
queries.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
50
51
52
demographics = """
select * from participants;
"""
courts_data = """
select
re.case_id,
of.offense_category,
se.sentence_type,
co.court_name
from results re
left join offenses of
on re.offense_id = of.offense_id
left join sentences se
on re.sentence_id = se.sentence_id
left join courts co
on re.court_id = co.court_id;
"""
length_scatter = """
select
re.length_of_case_in_days,
se.month,
se.year,
of.offense_category,
se.sentence_type
from results re
left join offenses of
on re.offense_id = of.offense_id
left join sentences se
on re.sentence_id = se.sentence_id;
"""
offense_box = """
select
re.length_of_case_in_days,
of.offense_category
from results re
left join offenses of
on re.offense_id = of.offense_id;
"""
age_box = """
select
pa.age_at_incident,
of.offense_category
from results re
left join offenses of
on re.offense_id = of.offense_id
left join participants pa
on re.case_participant_id = pa.case_participant_id;
"""