The delivery centre needs a quarterly view of approved, billable work logged against active delivery projects. Write a PostgreSQL query that joins project and work-log data and returns only projects meeting the minimum effort threshold.
Requirements
- Consider active projects in the delivery centre portfolio.
- Include only approved, billable work logs recorded from
2025-01-01 through 2025-03-31.
- Return each qualifying project's ID, name, delivery centre, manager, total approved billable hours, and log count.
- Keep projects with no qualifying logs during the join, but return only projects with at least 20 approved billable hours. Classify totals of 40 hours or more as
High, otherwise as Standard.
Output details
- Return columns in this order:
project_id, project_name, delivery_centre, manager_name, approved_billable_hours, log_count, effort_level.
- Order rows by
approved_billable_hours descending, then project_id ascending.
- Preserve NULL
manager_name values as NULL.