-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSQL PROJECT QUERY.sql
More file actions
151 lines (102 loc) · 3.56 KB
/
SQL PROJECT QUERY.sql
File metadata and controls
151 lines (102 loc) · 3.56 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
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
create database sql_task;
use sql_task;
show tables;
-- QUESTIONS:-
-- 1. What is the gender distribution of respondents from India?
SELECT * FROM dataset;
SELECT Gender, COUNT(*) AS COUNT
FROM dataset
WHERE Country="INDIA"
GROUP BY Gender;
-- 2. What percentage of respondents from India are interested in education abroad and sponsorship?
SELECT
(COUNT(*) * 100.0 /
(SELECT COUNT(*)
FROM dataset
WHERE country = 'India')
) AS percentage
FROM dataset
WHERE country = 'India'
AND Higher_Education_Aspiration IN ('Yes', 'Needs a sponsor');
-- 3. What are the 6 top influences on career aspirations for respondents in India?
SELECT
Influencing_Factors,
COUNT(*) AS influence_count
FROM dataset
WHERE country = 'India'
GROUP BY Influencing_Factors
ORDER BY influence_count DESC
LIMIT 6;
-- 4. How do career aspiration influences vary by gender in India?
SELECT
Gender,
Higher_Education_Aspiration,
COUNT(*) AS influence_count
FROM dataset
WHERE country = 'India'
GROUP BY Gender,Higher_Education_Aspiration
ORDER BY Gender, Higher_Education_Aspiration ;
-- 5. What percentage of respondents are willing to work for a company for at least 3 years?
SELECT
(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM dataset)) AS percentage
FROM dataset
WHERE 3_year_tenurity = 'yes';
-- 6. How many respondents prefer to work for socially impactful companies?
SELECT
COUNT(*) AS respondent_count
FROM dataset
WHERE Likley_Rate_For_Unethical_Company >= 5;
-- 7. How many preference for socially impactful companies vary by gender?
SELECT
gender,
COUNT(*) AS respondent_count
FROM dataset
WHERE Likley_Rate_For_Unethical_Company >= 5
GROUP BY gender
ORDER BY respondent_count DESC;
-- 8. What is the distribution of minimum expected salary in the first three years among respondents?
SELECT
Minimum_expected_in_hand_monthly_salary_after_3_years,
COUNT(*) AS respondent_count
FROM dataset
GROUP BY Minimum_expected_in_hand_monthly_salary_after_3_years
ORDER BY Minimum_expected_in_hand_monthly_salary_after_3_years
DESC;
-- 9. What is the expected minimum monthly salary in hand?
SELECT
Minimum_expected_in_hand_monthly_salary_after_3_years
FROM dataset
GROUP BY Minimum_expected_in_hand_monthly_salary_after_3_years
ORDER BY Minimum_expected_in_hand_monthly_salary_after_3_years
DESC;
-- 10. What percentage of respondents prefer remote working?
SELECT
(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM dataset)) AS percentage
FROM dataset
WHERE work_in_environment = 'Remote_work';
-- 11. What is the preferred number of daily work at office?
SELECT
work_in_environment,
COUNT(*) AS respondent_count
FROM dataset where work_in_environment = 'Every_Day_Office_work'
GROUP BY work_in_environment
ORDER BY work_in_environment ASC;
-- 12. What is the distribution of minimum expected salary after five years?
SELECT
Minimum_expected_in_hand_monthly_salary_after_5_years,
COUNT(*) AS respondent_count
FROM dataset
GROUP BY Minimum_expected_in_hand_monthly_salary_after_5_years
ORDER BY Minimum_expected_in_hand_monthly_salary_after_5_years ASC;
-- 13. What are the remote working preferences by gender?
SELECT
gender,
COUNT(*) AS respondent_count
FROM dataset where work_in_environment = 'remote_work'
GROUP BY gender
ORDER BY gender, respondent_count ;
-- 14. What percentage of respondents need sponsorship for education abroad?
SELECT
(COUNT(*) * 100.0 / (SELECT COUNT(*) FROM dataset)) AS sponsorship_percentage
FROM dataset
WHERE Higher_Education_Aspiration = 'Needs a sponsor';