SELECT
m.name,
m.position,
COUNT(e.name) AS number_of_subordinates
FROM
employees as e
RIGHT JOIN employees as m
ON e.manager_id = m.id
GROUP BY m.name
WHERE m.is_manager = 1
SELECT
e.name as Employee,
e.position as Position,
m.name as Manager
FROM
employees as e
LEFT JOIN employees as m
ON e.manager_id = m.id