Files and databases · GCSE · OCR J277 2.2.3, AQA 8525 3.7.2 · about 15 min
SELECT, FROM, WHERE and ORDER BY on the class's robot runs.
[1 mark]Which SQL keyword names the table to search?
[1 mark]Put the parts of a query in order.
Number the lines 1 to 4 to put them in the right order.
ORDER BY cm DESCWHERE task = 'wall'SELECT run_id, cmFROM runs[1 mark]What does SELECT * FROM robots return?
[1 mark]Runs have cm values 42, 80, 38, 45.5, 76.5 and 81. Which match WHERE cm > 76.5?
Tick every answer that is true.
[1 mark]Complete the query so it lists the longest runs first: SELECT run_id, cm FROM runs ORDER BY cm ____
Write one SQL query that finds the run_id and cm of every square run longer than 77 cm, longest first, and print each result as run 6: 81.0 cm. Then drive forward the distance of the shortest of those runs, divided by 4.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() import logbook db = logbook.open_db()
Plan your program here, then type it in and press Run.
SELECT run_id FROM runs WHERE cm > 50. How many lines is it?