This advanced SQL exercise is part of the book: Advanced SQL – Practical Techniques and Use-Cases, which includes 100 day-to-day SQL challenges (and solutions), need-to-know advanced features, and key concepts.

Given the following Employees table. This table displays various employees and the dates when they were absent from work. For example, Mary was on a vacation from January 1st to January 3rd.

CREATE TABLE employees
(employeeID int identity(1,1),
employeeName varchar(25),
departmentID int,
strt_date date,
end_date date)

Would you like to read more?