Programming fundamentals
30
0/3

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:

FieldnameDescription
LogDateThe date the reading was taken
DeviceIDThe unique ID of the sensor
DeviceTypeThe type of sensor – Thermostat, Humidity, or CO2
ReadingThe numerical measurement

The log is stored in a database table called sensor_logs. The current contents of sensor_logs are shown:

LogDateDeviceIDDeviceTypeReading
12/10/2023TH_A1Thermostat22
12/10/2023HM_B3Humidity45
13/10/2023CO_C1CO2410
13/10/2023TH_A2Thermostat26
14/10/2023HM_B3Humidity55
14/10/2023TH_A1Thermostat25
15/10/2023CO_C2CO2390

Write an SQL statement to display the device IDs of the thermostat devices that have recorded a reading of more than 24.

[3]

Programming fundamentals Questions

Practise OCR GCSE Computer Science Programming fundamentals with exam-style questions for GCSE Computer Science. 100 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.

PreviousNext

Programming fundamentals Questions

  1. GCSE
  2. /Computer Science
  3. /Programming fundamentals