Your question is Employee and Department Join With NULLs. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Yardi Voyager exports employee records separately from department reference data. Write a PostgreSQL query that reports each employee and the department name associated with their dept_id.
dept_id is NULL.dept_id.emp_id, name, and dept_name.emp_id in ascending order. If no department matches, dept_name must remain NULL.| Column | Type | Description |
|---|---|---|
| emp_idPK | INT | Unique employee identifier |
| name | VARCHAR(100) | Employee full name |
| dept_id | INT | Optional reference to departments.dept_id |
| Column | Type | Description |
|---|---|---|
| dept_idPK | INT | Unique department identifier |
| dept_name | VARCHAR(100) | Department display name |