-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenzdata-dump file part 2.sql
209 lines (187 loc) · 8.09 KB
/
Genzdata-dump file part 2.sql
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
use genzdataset;
-- ques 1
select count(responseID) from learning_aspirations
where PreferredWorkingEnvironment like '%every day office%';
-- ques 1
select sum(case when Gender like 'Male%' then 1 else 0 end) as male_learning ,
sum(case when Gender like 'Female%' then 1 else 0 end) as female_learning
from learning_aspirations inner join personalized_info on personalized_info.ResponseID = learning_aspirations.ResponseID
where PreferredWorkingEnvironment like '%every day office%';
-- ques 2
select (count(ResponseID)/(select count(*) from learning_aspirations ))* 100 as percentage from learning_Aspirations
where CareerInfluenceFactor like '%parents%' and ClosestAspirationalCareer like 'business operations%';
-- ques 3
select (count( case when p.Gender like 'Male%' then 1 end)/count(*))*100 as Males_aspirant,
(count(case when p.Gender like 'Female%' then 1 end )/count(*))*100 as Females_aspir
from learning_aspirations l
inner join personalized_info p on l.ResponseID = p.ResponseID
where HigherEducationAbroad like '%Yes%' ;
-- ques 4
select (count( case when p.Gender like 'Male%' then 1 end)/count(*))*100 as Males_WanttoWork,
(count(case when p.Gender like 'Female%' then 1 end )/count(*))*100 as Females_WanttoWork
from mission_aspirations m inner join personalized_info p on m.ResponseID = p.ResponseID
where MisalignedMissionLikelihood like 'will work%';
select (count( case when p.Gender like 'Male%' then 1 end)/count(*))*100 as Males_notWanttoWork,
(count(case when p.Gender like 'Female%' then 1 end )/count(*))*100 as Females_notWanttoWork
from mission_aspirations m inner join personalized_info p on m.ResponseID = p.ResponseID
where MisalignedMissionLikelihood like 'will not work%';
-- ques 5
SELECT DISTINCT(l.PreferredWorkingEnvironment), count(*) as freq
FROM learning_aspirations l
INNER JOIN personalized_info p
ON l.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Female%'
GROUP BY l.PreferredWorkingEnvironment
ORDER BY freq DESC;
-- ques 6
SELECT count(p.Gender)
FROM mission_aspirations m
INNER JOIN personalized_info p ON m.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Female%' AND m.NoSocialImpactLikelihood BETWEEN 1 AND 5;
-- query 7
select count( case when p.Gender like 'Male%' then 1 end) as Males_aspirant
from learning_aspirations l
inner join personalized_info p on l.ResponseID = p.ResponseID
where l.HigherEducationAbroad like '%Yes%' and l.CareerInfluenceFactor like '%parents%' ;
-- query 8
SELECT
(count(case when p.gender like 'Male%' then 1 end)/count(*))*100 as Total_male,
(count(case when p.gender like 'Female%' then 1 end)/count(*))*100 as Total_Female
FROM mission_aspirations m
INNER JOIN personalized_info p ON m.ResponseID = p.ResponseID
inner join learning_aspirations l on l.ResponseID=m.ResponseID
WHERE m.NoSocialImpactLikelihood BETWEEN 8 AND 10 and l.HigherEducationAbroad like '%yes%';
-- query 9
WITH GenderCounts AS (
SELECT
p.Gender,
ma.PreferredWorkSetup,
COUNT(*) AS Count
FROM
manager_aspirations ma
INNER JOIN
personalized_info p ON ma.ResponseID = p.ResponseID
WHERE
ma.PreferredWorkSetup LIKE '%team%'
GROUP BY
p.Gender, ma.PreferredWorkSetup
)
SELECT
Gender,
PreferredWorkSetup,
Count,
ROUND(Count * 100.0 / SUM(Count) OVER (PARTITION BY PreferredWorkSetup), 2) AS Percentage
FROM
GenderCounts
ORDER BY
PreferredWorkSetup, Gender;
-- query 10
SELECT DISTINCT(WorkLikelihood3Years)
FROM manager_aspirations;
SELECT COUNT(ma.WorkLikelihood3Years) AS Female_will_work
FROM manager_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Female%' AND ma.WorkLikelihood3Years LIKE 'Will work%';
SELECT COUNT(ma.WorkLikelihood3Years) AS Female_will_be_hard
FROM manager_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Female%' AND ma.WorkLikelihood3Years LIKE 'This will%';
SELECT COUNT(ma.WorkLikelihood3Years) AS Female_No_way
FROM manager_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Female%' AND ma.WorkLikelihood3Years LIKE 'No way';
SELECT COUNT(ma.WorkLikelihood3Years) AS Female_No_way_crazy
FROM manager_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Female%' AND ma.WorkLikelihood3Years LIKE 'No way%';
/* Now for Male */
SELECT COUNT(ma.WorkLikelihood3Years) AS Male_will_work
FROM manager_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Male%' AND ma.WorkLikelihood3Years LIKE 'Will work%';
SELECT COUNT(ma.WorkLikelihood3Years) AS Male_will_be_hard
FROM manager_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Male%' AND ma.WorkLikelihood3Years LIKE 'This will%';
SELECT COUNT(ma.WorkLikelihood3Years) AS Male_No_way
FROM manager_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Male%' AND ma.WorkLikelihood3Years LIKE 'No way';
SELECT COUNT(ma.WorkLikelihood3Years) AS Male_No_way_crazy
FROM manager_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.Gender LIKE 'Male%' AND ma.WorkLikelihood3Years LIKE 'No way%';
-- query 11
SELECT p.Gender,
AVG(CAST(SUBSTRING_INDEX(ExpectedSalary3Years, 'k', 1) AS SIGNED)) AS Avg_Starting_Salary
FROM personalized_info p
INNER JOIN mission_aspirations m2
ON p.ResponseID = m2.ResponseID
GROUP BY p.Gender;
-- query 12
SELECT p.Gender,
AVG(CAST(SUBSTRING_INDEX(ExpectedSalary5Years, 'k', 1) AS SIGNED)) AS Avg_Starting_Salary
FROM personalized_info p
INNER JOIN mission_aspirations m2
ON p.ResponseID = m2.ResponseID
GROUP BY p.Gender;
-- query 13
SELECT p.Gender,
AVG(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(ExpectedSalary3Years,'to',-1),'k',1) AS SIGNED)) AS Avg_Higherbar_Salary
FROM personalized_info p
INNER JOIN mission_aspirations m2
ON p.ResponseID = m2.ResponseID
GROUP BY p.Gender;
-- query 14
SELECT p.Gender,
AVG(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(ExpectedSalary5Years,'to',-1),'k',1) AS SIGNED)) AS Avg_Higherbar_Salary
FROM personalized_info p
INNER JOIN mission_aspirations m2
ON p.ResponseID = m2.ResponseID
GROUP BY p.Gender;
-- query 15
SELECT p.Gender,
AVG(CAST(SUBSTRING_INDEX(ExpectedSalary3Years, 'k', 1) AS SIGNED)) AS Avg_Starting_Salary
FROM personalized_info p
INNER JOIN mission_aspirations m2
ON p.ResponseID = m2.ResponseID
WHERE p.CurrentCountry LIKE 'India%'
GROUP BY p.Gender;
-- query 16
SELECT p.Gender,
AVG(CAST(SUBSTRING_INDEX(ExpectedSalary5Years, 'k', 1) AS SIGNED)) AS Avg_Starting_Salary
FROM personalized_info p
INNER JOIN mission_aspirations m2
ON p.ResponseID = m2.ResponseID
WHERE p.CurrentCountry LIKE 'India%'
GROUP BY p.Gender;
-- query 17
SELECT p.Gender,
AVG(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(ExpectedSalary3Years,'to',-1),'k',1) AS SIGNED)) AS Avg_Higherbar_Salary
FROM personalized_info p
INNER JOIN mission_aspirations m2
ON p.ResponseID = m2.ResponseID
WHERE p.CurrentCountry LIKE 'India%'
GROUP BY p.Gender;
-- query 18
SELECT p.Gender,
AVG(CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(ExpectedSalary5Years,'to',-1),'k',1) AS SIGNED)) AS Avg_Higherbar_Salary
FROM personalized_info p
INNER JOIN mission_aspirations m2
ON p.ResponseID = m2.ResponseID
WHERE p.CurrentCountry LIKE 'India%'
GROUP BY p.Gender;
-- query 19
SELECT
COUNT(CASE WHEN p.Gender LIKE 'Male%' THEN 1 END) AS Male_GenZ,
COUNT(CASE WHEN p.Gender LIKE 'Female%' THEN 1 END) AS Female_GenZ
FROM mission_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.CurrentCountry LIKE 'India%' AND ma.MisalignedMissionLikelihood LIKE 'Will work%';
-- these people will not work for comapnies whose mission is misaligned
SELECT
COUNT(CASE WHEN p.Gender LIKE 'Male%' THEN 1 END) AS Male_GenZ,
COUNT(CASE WHEN p.Gender LIKE 'Female%' THEN 1 END) AS Female_GenZ
FROM mission_aspirations ma
INNER JOIN personalized_info p ON ma.ResponseID = p.ResponseID
WHERE p.CurrentCountry LIKE 'India%' AND ma.MisalignedMissionLikelihood LIKE 'Will NOT%';