-
Notifications
You must be signed in to change notification settings - Fork 0
/
questions.txt
33 lines (27 loc) · 2.19 KB
/
questions.txt
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
1.Basic Queries
a. Count the number of employees are there in each age group.
b. How many male and female employees are working?
c. How many employees travel for business frequently, rarely, or never? (Rename column as EmployeeCount)
d. How many employees in each education field with more than 3 JobLevels, ordered by the count of employees in ascending order?
e. What is the average age of employees in each job role with 'Manager' in the title, ordered by average age in ascending order?
2.Joins and Subquery
a. What is the monthly income and job satisfaction level of each employee?(Using General_data and employee_survey_data)
b. How many employees are there in each job role with their respective job satisfaction levels?
c. Get the gender and work-life balance level for each employee, including those without any survey data.
d. Get the job role, work-life balance, and performance rating of employees, only for those with data in all tables.
e. Find the employee ID who has a monthly income above the average monthly income.
f. Find the employee ID who lives closer than the average distance from home.
3.Case Queries
a. Find the employees who work in either the Sales or Research and Development departments.
b. Find the employees who are in either Job Level 3 or Job Level 4.
c. Classify employees into income brackets ('Low', 'Medium', 'High') based on their monthly income.(Low=20,000 and Medium= 20,000 to 70,000 , high>=70,000)
d. Categorize employees based on their distance from home into 'Close', 'Medium', and 'Far'. (close<=7, medium 7 to 20, far>=20)
e. Count number of employees in 'Human Resources' and 'Other' departments(using case statements)
4.Window Queries
a. Assign a rank to each employee based on their monthly income.(Using Window Function)
b. Calculate the average monthly income within each department.(Using Window Function)
c. Calculate the third highest monthly income within each department.
d. Calculate the difference between each employee's monthly income and the previous employee's monthly income in the dataset.
5.CTE Queries
a. Find employees who have a monthly income above 5000
b. Calculate the total monthly income for each department.