Your question is Rolling 7-Day Telemetry Average in SQL. Start with the requirements and the two tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Datadog monitors telemetry ingestion for customer accounts. Write a PostgreSQL query that calculates each active account's daily telemetry ingestion rate and its rolling 7-day average from January 1 through January 7, 2024.
NULL ingestion rates as zero.| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Unique Datadog customer account identifier |
| account_name | VARCHAR(100) | Customer account name |
| status | VARCHAR(20) | Account lifecycle status |
| Column | Type | Description |
|---|---|---|
| ingestion_idPK | INT | Unique telemetry measurement identifier |
| account_id | INT | Customer account receiving telemetry |
| ingestion_date | DATE | Date of the telemetry measurement |
| ingestion_rate | NUMERIC(12,2) | Telemetry events ingested during the measurement interval |