Given tables for tasks, owners, and status updates, how would you find overdue work and summarize it by owner using SQL at Attentive?
Use 2025-02-01 as the reporting date. A task is overdue when its due date is before that date and its latest status is not Completed. Include tasks without status updates and tasks without an assigned owner.
Output
- One row per owner, including
Unassigned when applicable.
- Columns:
owner_id, owner_name, overdue_count, and overdue_task_ids.
- Sort by overdue count descending, then owner name ascending.