Write a SQL query to join multiple tables and aggregate performance metrics over a specific time window.
Use the provided site, asset, and performance record tables. Analyze records from January 1, 2025 through March 31, 2025, inclusive. Include sites without qualifying performance records.
Output
- One row per site.
- Return
site_id, site_name, asset_count, avg_availability_pct, total_production_units, and avg_energy_kwh.
- Count all assets assigned to each site, but calculate metrics only from records in the time window.
- Preserve
NULL for averages with no qualifying values, use zero for total production with no qualifying records, and order by site_id ascending.