;WITH cte AS
(
SELECT a.name,
CASE WHEN c.slotid IS null THEN 0 ELSE c.slotid END AS slotid
FROM #employees AS a
LEFT JOIN #schedules AS c ON a.name LIKE c.empname
)
SELECT a.name,
b.timestart,
b.timeend
FROM cte AS a
INNER JOIN #timeslots AS b ON a.slotid <> b.id
BTW, your expected output is wrong. There are five time slots, so employees 1, 2, and 3 will have FIVE available timeslots, not four, and emp4 will have five.
name slotid timestart timeend
emp1 2 10:00:00.0000000 12:00:00.0000000
emp1 3 16:00:00.0000000 18:00:00.0000000
emp1 4 08:00:00.0000000 16:00:00.0000000
emp1 5 14:00:00.0000000 18:00:00.0000000
emp2 1 08:00:00.0000000 10:00:00.0000000
emp2 3 16:00:00.0000000 18:00:00.0000000
emp2 4 08:00:00.0000000 16:00:00.0000000
emp2 5 14:00:00.0000000 18:00:00.0000000
emp3 1 08:00:00.0000000 10:00:00.0000000
emp3 2 10:00:00.0000000 12:00:00.0000000
emp3 3 16:00:00.0000000 18:00:00.0000000
emp3 5 14:00:00.0000000 18:00:00.0000000
emp4 1 08:00:00.0000000 10:00:00.0000000
emp4 2 10:00:00.0000000 12:00:00.0000000
emp4 3 16:00:00.0000000 18:00:00.0000000
emp4 4 08:00:00.0000000 16:00:00.0000000
emp4 5 14:00:00.0000000 18:00:00.0000000