How would you join two large datasets when the join condition is not strict, and you need to keep only the relevant rows?
Use the supplied gpu_telemetry and thermal_rules tables. Return only telemetry readings that satisfy the applicable device, validity-period, and temperature conditions.
reading_id, device_id, measured_at, temperature_c, rule_id, severity.measured_at, reading_id, and rule_id ascending.| Column | Type | Description |
|---|---|---|
| reading_idPK | INT | Unique telemetry reading identifier |
| device_id | VARCHAR(20) | GPU device identifier |
| measured_at | TIMESTAMP | Time when the reading was recorded |
| temperature_c | DECIMAL(5,2) | Measured temperature in Celsius |
| Column | Type | Description |
|---|---|---|
| rule_idPK | INT | Unique thermal rule identifier |
| device_id | VARCHAR(20) | GPU device to which the rule applies |
| valid_from | TIMESTAMP | Inclusive start of the rule validity period |
| valid_to | TIMESTAMP | Exclusive end of the rule validity period, null means no end |
| min_temperature_c | DECIMAL(5,2) | Minimum temperature accepted by the rule |
| max_temperature_c | DECIMAL(5,2) | Maximum temperature accepted by the rule, null means no upper limit |
| severity | VARCHAR(20) | Classification assigned by the rule |