An automated greenhouse system has a log that records data each time an environmental sensor takes a reading. The record format is given in the table:
| Fieldname | Description |
|---|---|
| LogDate | The date the reading was taken |
| DeviceID | The unique ID of the sensor |
| DeviceType | The type of sensor – Thermostat, Humidity, or CO2 |
| Reading | The numerical measurement |
The log is stored in a database table called sensor_logs. The current contents of sensor_logs are shown:
| LogDate | DeviceID | DeviceType | Reading |
|---|---|---|---|
| 12/10/2023 | TH_A1 | Thermostat | 22 |
| 12/10/2023 | HM_B3 | Humidity | 45 |
| 13/10/2023 | CO_C1 | CO2 | 410 |
| 13/10/2023 | TH_A2 | Thermostat | 26 |
| 14/10/2023 | HM_B3 | Humidity | 55 |
| 14/10/2023 | TH_A1 | Thermostat | 25 |
| 15/10/2023 | CO_C2 | CO2 | 390 |
Write an SQL statement to display the device IDs of the thermostat devices that have recorded a reading of more than 24.
Practise OCR GCSE Computer Science Additional programming techniques with exam-style questions for GCSE Computer Science. 5 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.