A company needs to validate and reconcile workforce data between two systems: employees and attendance. Write a SQL query to compare the number of employees with recorded attendance and those without. The goal is to identify discrepancies in workforce data.
employees and attendance tables on employee_id.employees (employee_id, name, department)
| employee_id | name | department |
|---|---|---|
| 1 | Alice | HR |
| 2 | Bob | IT |
| 3 | Charlie | HR |
| 4 | Diana | Marketing |
| 5 | Eve | IT |
attendance (record_id, employee_id, date)
| record_id | employee_id | date |
|---|---|---|
| 1 | 1 | 2024-01-01 |
| 2 | 2 | 2024-01-02 |
| 3 | 3 | 2024-01-01 |
| 4 | 1 | 2024-01-03 |
| 5 | 5 | 2024-01-02 |
| status | count |
|---|---|
| With Attendance | 3 |
| Without Attendance | 2 |