|
| 1 | +-- Employee Salary Analysis and Visualization |
| 2 | + |
| 3 | +-- Select all records from employeedata in the empreport |
| 4 | +SELECT * FROM empreport.employeedata; |
| 5 | + |
| 6 | +-- 1. What is the total number of employees, and how many are there in each job title? |
| 7 | +-- This helps to understand the distribution of employees across different roles. |
| 8 | +-- Use a Card and Matrix Chart to easily count the total number of employees and the count in each job title. |
| 9 | +SELECT Job_Title, COUNT(*) AS Employee_Count |
| 10 | +FROM empreport.employeedata |
| 11 | +GROUP BY Job_Title; |
| 12 | + |
| 13 | +-- 2. What is the average salary by Job title? |
| 14 | +-- This highlight compensation trends across different positions. |
| 15 | +SELECT Job_Title, ROUND(AVG(Salary), 0) AS Average_Salary |
| 16 | +FROM EmployeeData |
| 17 | +GROUP BY Job_Title |
| 18 | +ORDER BY Job_Title ASC; |
| 19 | + |
| 20 | +-- 3. What is the distribution of experience levels within the company? |
| 21 | +-- Understanding the distribution of experience can aid in planning for training and development. |
| 22 | +-- Use a Pie Chart to show the proportion of each experience level within the company, providing a quick view of the distribution. |
| 23 | +-- Use a Stacked Bar Chart to compare average salaries side-by-side for males and females across various job roles or departments. |
| 24 | +SELECT Experience_Level, COUNT(*) AS Count |
| 25 | +FROM EmployeeData |
| 26 | +GROUP BY Experience_Level; |
| 27 | + |
| 28 | +-- 4. What are the common work settings and their salaries? |
| 29 | +-- This can show if remote work settings influence salaries differently. |
| 30 | +-- Clustered Column Chart show average salaries for different work settings and show the count of employees in each setting. |
| 31 | +SELECT Work_Setting, ROUND (AVG(Salary), 0) AS Average_Salary, COUNT(*) AS Employee_Count |
| 32 | +FROM EmployeeData |
| 33 | +GROUP BY Work_Setting; |
| 34 | + |
| 35 | +-- 5. How does employee distribution vary by location? |
| 36 | +-- Identifying if certain locations have more employees can influence regional policies. |
| 37 | +-- Use a Treemap chart to show the distribution across different regions. |
| 38 | +SELECT Location, COUNT(*) AS Employee_Count |
| 39 | +FROM EmployeeData |
| 40 | +GROUP BY Location; |
| 41 | + |
| 42 | + |
| 43 | +-- 6. What is the salary range within each company size category? |
| 44 | +-- Examining how salary ranges differ between small, medium, and large companies. |
| 45 | +-- Display the distribution of salaries, highlighting the median, quartiles, and outliers within each company size category. |
| 46 | +SELECT Company_Size, |
| 47 | + MIN(Salary) AS Minimum_Salary, |
| 48 | + MAX(Salary) AS Maximum_Salary, |
| 49 | + ROUND(AVG(Salary), 0) AS Average_Salary |
| 50 | +FROM EmployeeData |
| 51 | +GROUP BY Company_Size; |
| 52 | + |
0 commit comments