-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueries.py
More file actions
63 lines (51 loc) · 1.87 KB
/
queries.py
File metadata and controls
63 lines (51 loc) · 1.87 KB
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
53
54
55
56
57
58
59
60
61
62
63
# -- Qual formato (FT/PT) os alunos melhor avaliam?
part_time_score = """SELECT program , AVG(overallScore)
FROM comments
WHERE program LIKE '%Part-Time%'
GROUP BY `program`;"""
full_time_score = """SELECT program , AVG(overallScore)
FROM comments
WHERE program LIKE '%bootcamp%'
GROUP BY `program`;"""
# Q3 - Overallscore ao longo do tempo (verificar esperialmente o curriculum e o jobsupport)
curriculum_time = """select AVG(curriculum), graduatingYear, count(curriculum)
from comments
group by graduatingYear
order by graduatingYear asc;"""
job_support_time = """select AVG(jobSupport), graduatingYear, count(jobSupport)
from comments
group by graduatingYear
order by graduatingYear asc;"""
overall_score_time = """select AVG(overallScore), graduatingYear, count(overallScore)
from comments
group by graduatingYear
order by graduatingYear asc;"""
# Q4 - Qual o perfil das pessoas que mais avaliam?
profile_by_program = """SELECT program, COUNT(review_body)
FROM comments
GROUP BY program;"""
profile_by_alumni = """SELECT isAlumni, COUNT(review_body)
FROM comments
GROUP BY isAlumni;"""
profile_by_workInField = """SELECT Work_inField, isAlumni, COUNT(review_body)
FROM comments
GROUP BY Work_inField, isAlumni;"""
# Q5 - Como os estudantes que trabalham na área avaliam a Ironhack para melhorar a carreira?
overall_student_rate = """SELECT AVG(overallscore), COUNT(overallScore)
FROM (SELECT * FROM comments
WHERE Work_inField = 1
AND isAlumni = 0) sub_1
GROUP BY school
ORDER BY AVG(overallScore) ASC;"""
curriculum_student_rate = """SELECT AVG(curriculum), COUNT(curriculum)
FROM (SELECT * FROM comments
WHERE Work_inField = 1
AND isAlumni = 0) sub_2
GROUP BY school
ORDER BY AVG(curriculum) ASC;"""
jobSupport_student_rate = """SELECT AVG(jobSupport), COUNT(jobSupport)
FROM (SELECT * FROM comments
WHERE Work_inField = 1
AND isAlumni = 0) sub_3
GROUP BY school
ORDER BY AVG(jobSupport) ASC;"""