queries
queries
marital_status varchar(50),
age_band varchar(50),
age int8,
department varchar(50),
education varchar(50),
education_field varchar(50),
job_role varchar(50),
business_travel varchar(50),
employee_count int8,
attrition varchar(50),
attrition_label varchar(50),
job_satisfaction int8,
active_employee int8
Employee Count:
select sum(employee_count) as Employee_Count from hrdata;
Attrition Count:
select count(attrition) from hrdata where attrition='Yes';
Attrition Rate:
select
round (((select count(attrition) from hrdata where attrition='Yes')/
sum(employee_count)) * 100,2)
from hrdata;
Active Employee:
select sum(employee_count) - (select count(attrition) from hrdata where attrition='Yes')
from hrdata;
OR
Average Age:
select round(avg(age),0) from hrdata;
Attrition by Gender
select gender, count(attrition) as attrition_count from hrdata
where attrition='Yes'
group by gender
(select count(attrition) from hrdata where attrition= 'Yes')) * 100, 2) as pct from hrdata
where attrition='Yes'
group by department
GROUP BY age
order by age;
where attrition='Yes'
group by education_field