๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐๐ฒ๐ฟ: Find all employees who *donโt have a manager* (i.e.,
manager_id is NULL) and list their names and departments. ๐ ๐ฒ: Using
WHERE with IS NULL:SELECT name, department
FROM employees
WHERE manager_id IS NULL;
โ Why it works:
โ
IS NULL filters rows where manager_id is missing. โ Simple and fast for identifying top-level employees in an organization.
๐ Bonus Tip: Combine with
LEFT JOIN to also include department names from another table if needed. ๐ฌ Tap โค๏ธ if this helped you!