Write a SQL query to calculate daily processing throughput by facility and compare it to target.
Use the provided facility, processing event, and daily target data. Throughput is the total units from completed events only.
Output
- One row per facility and target date with a matching facility
- Columns:
facility_name, processing_date, daily_throughput, target_units, variance_units, and performance_status
- Include dates with no completed processing as zero throughput
- Sort by
facility_name, then processing_date