Write an SQL query using window functions to compute a rolling 7-day count of alerts per customer and rank customers by alert volume within each week for SentinelOne.
Use the customers and alerts tables. Include only alerts associated with a known customer and a non-null alert date.
week_start, customer_id, customer_name, alert_date, daily_alerts, rolling_7_day_alerts, weekly_alert_volume, and weekly_rank.week_start, alert_date, and customer_id ascending. Customers tied on weekly volume share the same rank.| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique SentinelOne customer identifier |
| customer_name | VARCHAR(120) | Customer organization name |
| Column | Type | Description |
|---|---|---|
| alert_idPK | INT | Unique alert identifier |
| customer_id | INT | Customer associated with the alert |
| occurred_on | DATE | Calendar date on which the alert occurred |
| severity | VARCHAR(20) | Alert severity classification |