Summative Assessment Answers – Databases and SQL – KS4
Summative Assessment Answers – Databases and SQL – KS4
The table above (tblSpeeds) is data collected from a speed camera on a motorway.
The camera captures the car registration plate and the speed at which the car was
travelling. The car reg is used to find the registered owner of the car, and the data is
stored in a flat file database.
Q1. Which of the fields above would be most suitable to be the primary key? [1]
A. CaptureID
B. Registered_owner
C. Car_reg
D. Speed
CaptureID is the field that is guaranteed to be unique. All of the other data in this
table is not guaranteed to be unique.
Q3. What would be the most appropriate data type for car_reg?
A. TEXT
B. INTEGER
C. REAL
D. NULL
Q4. What would be the most appropriate data type for Speed?
A. TEXT
B. INTEGER
C. REAL
D. NULL
Q5. The data is in a flat file database. Describe one problem that can arise from having a
flat file database. [2]
Q6. Write down the exact output for the following query: [1]
1 SELECT Registered_owner
2 FROM tblSpeeds
3 WHERE Speed > 75;
Sara Bibi
Q7. The authorities want to offer a speed awareness course to those drivers recorded as
travelling between 71 and 80. Write a query to extract the appropriate records from
tblSpeeds. You must show all the fields in your output. [3]
1 SELECT *
2 FROM tblSpeeds
3 WHERE Speed BETWEEN 71 AND 80;
Q8. The camera has captured a new car travelling down the motorway. Write an SQL
script to insert the following data into tblSpeeds. [4]
Q9. The registered owner of vehicle YM15PTO has written to say that they are no longer
the registered owner. Write a script to update the registered_owner field in
tblSpeeds for this vehicle to ‘Asif Shah’. [3]
1 UPDATE tblSpeeds
2 SET registered_owner = "Asif Shah"
3 WHERE car_reg = "YM15PTO";
Q10. It has been proven that the camera needed calibrating and an incorrect speed was
recorded for CaptureID number 6.
Write an SQL query that will delete this record from tblSpeeds. [2]
Resources are updated regularly — the latest version is available at: ncce.io/tcc.
This resource is licensed under the Open Government Licence, version 3. For more information on this
licence, see ncce.io/ogl.