Equinor's offshore operations teams use sensor data to monitor temperature trends in production equipment. Write a PostgreSQL query that calculates a seven-day rolling average for each sensor.
quality_status is not VALID or whose temperature is NULL.sensor_id and measured_day.| Column | Type | Description |
|---|---|---|
| reading_idPK | INTEGER | Unique sensor reading identifier |
| sensor_id | VARCHAR(30) | Equipment sensor identifier |
| measured_at | TIMESTAMPTZ | Timestamp when the reading was captured |
| temperature_c | NUMERIC(6,2) | Temperature measurement in degrees Celsius |
| quality_status | VARCHAR(20) | Quality classification for the reading |