ExamBank Scot · AH Computing Science question bank · All AH Computing Science questions

AH Computing Science 2022 Question 7

2 marks · Keys and surrogate keys

EcoVenture is a walking club. The club website allows registered walkers to record details about walking routes they complete. Data about the walkers and their completed walking routes is stored in a database with four related tables. The attributes in each table are listed below. Route Walker Hill Walk routeID routeName routeLength routeDifficulty hillID* walkerID walkerName walkerExperience walkerDOB hillID hillName hillType hillHeight walkerID* routeID* walkDate walkStartTime walkDistance walkEndTime walkDifficulty Explain why the Walk table would benefit from the introduction of a surrogate key.

Marking scheme

A surrogate key could be used to replace the current primary key which is a compound key. Use of a surrogate key would make it easier to reference historical data. It would also improve the performance of queries that involve a join with the Walk table. In this situation, it would allow a walker to record completion of a route more then once on the same day. 1 mark for purpose of the surrogate key 1 mark for one appropriate benefit

Previous question: AH Computing Science 2022 Question 6

Next question: AH Computing Science 2022 Question 8