-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbigQuery.sql
More file actions
51 lines (44 loc) · 1.96 KB
/
bigQuery.sql
File metadata and controls
51 lines (44 loc) · 1.96 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
-- QUESTION: Who are the most productive profiles by gender and job type?
-- Are they less stressed, do they sleep more, or spend less time on social media?
-- What patterns emerge among the top productivity scorers?
SELECT
gender,
job_type,
ROUND(AVG(actual_productivity_score), 2) AS avg_productivity,
ROUND(AVG(stress_level), 2) AS avg_stress,
ROUND(AVG(sleep_hours), 2) AS avg_sleep,
ROUND(AVG(breaks_during_work), 2) AS avg_breaks,
ROUND(AVG(daily_social_media_time), 2) AS avg_social_time
FROM
`ccbd-exam-2025-leonardi.social_media_vs_productivity.productivity_data`
GROUP BY gender, job_type
ORDER BY avg_productivity DESC
LIMIT 10;
-- QUESTION: How does social media usage relate to both perceived and actual productivity?
-- Do people using more social media actually perform worse, or do they just feel less productive?
-- Is there a correlation with stress levels?
SELECT
ROUND(daily_social_media_time, 0) AS social_time_bucket,
COUNT(*) AS users,
ROUND(AVG(perceived_productivity_score), 2) AS perceived_productivity,
ROUND(AVG(actual_productivity_score), 2) AS actual_productivity,
ROUND(AVG(stress_level), 2) AS avg_stress
FROM
`ccbd-exam-2025-leonardi.social_media_vs_productivity.productivity_data`
WHERE daily_social_media_time IS NOT NULL
GROUP BY social_time_bucket
ORDER BY social_time_bucket;
-- QUESTION: Which job types experience the most burnout and stress?
-- Is there a paradox where people are stressed but still satisfied with their jobs?
-- Which jobs show the worst combination of burnout and low satisfaction?
SELECT
job_type,
ROUND(AVG(days_feeling_burnout_per_month), 2) AS avg_burnout_days,
ROUND(AVG(stress_level), 2) AS avg_stress,
ROUND(AVG(job_satisfaction_score), 2) AS avg_satisfaction,
COUNT(*) AS total_people
FROM
`ccbd-exam-2025-leonardi.social_media_vs_productivity.productivity_data`
GROUP BY job_type
HAVING total_people > 5
ORDER BY avg_burnout_days DESC;