SQLeasyJoins~12m
You're an HR analyst at TechCorp
Problem
You're an HR analyst at TechCorp. The company wants to identify all departments that have employees who haven't taken any vacation days in the current year (2024), along with the count of such employees per department. Include only departments that actually have employees with zero vacation days taken. Return the department name and the count of employees with no vacation days, ordered by department name.
Examples
Example 1
Example 2
Constraints
- ›Return department_name and employees_with_no_vacation columns
- ›Only include departments that have at least one employee with zero vacation days in 2024
- ›Count only vacation leave_type, ignore sick days and personal days
- ›Order results by department name alphabetically
Reference solution
Reference solution available after you attempt the question.
Ready to solve it?
Start a session on Mockbit #49. Write your SQL, run it against real data, and get graded on correctness, efficiency, query structure, and business understanding.
Related SQL questions
- #41You're analyzing user engagement for a social media platformeasy
- #43A regional bank wants to analyze account activity by branch locationeasy
- #44A medical clinic wants to identify patients who have been prescribed medications...easy
- #42A video streaming platform tracks user viewing sessionshard
- #45A mobile gaming company wants to identify the top 3 most active players for each...easy
← Back homemockbit.io/q/49