Write a SQL query to find the top 3 performing assets in each sector over the last quarter.
Use the provided sector, asset, and performance data. Treat an asset's performance as the sum of its recorded returns during the previous calendar quarter. Exclude assets without a matching sector or performance record.
Output
- One row per selected asset, with
sector_name, asset_id, asset_name, quarterly_return_pct, and performance_rank.
- Include up to three assets per sector, ordered by return descending, with
asset_id as the tie-breaker.