Question 9

AQA Computer Science Specimen Paper 2 (7517/2)A level18 marks

On the specification

9.1
4.10 Fundamentals of databases
9.2
4.10 Fundamentals of databases
9.3
4.10 Fundamentals of databases
9.4
4.10 Fundamentals of databases
9.5
4.10 Fundamentals of databases
9.6 (inferred, text truncated)
4.10 Fundamentals of databases
Question text

9 A school stores information about its sports day in a relational database. The details of the track events are stored using the three relations in Figure 7. Figure 7 Athlete (AthleteNumber, Forename, Surname, Class, Gender, DateOfBirth) Race (RaceNumber, Gender, Distance, Type, StartTime) RaceEntryAndResult (RaceNumber, AthleteNumber, TimeSet) Each athlete who takes part in a race is given a unique AthleteNumber. Athletes can run in more than one race. If they do, they keep the same AthleteNumber for the entire day. Many races are run throughout the day. An example race would be the boys 80m hurdles, the third race of the day, which starts at 13:30. The entry in the Race table for this race is shown in Table 4: Table 4 RaceNumber Gender Distance Type StartTime 3 Boys 80 Hurdles 13:30 When an athlete is entered into a race, a record of the entry is created in the RaceEntryAndResult table. Initially, the TimeSet is recorded as 00:00.00 (meaning 0 minutes, 0 seconds, 0 hundredths of a second) to indicate that the race has not yet been run. After the race has been run, if the athlete successfully completes it, then their TimeSet value is updated to record the time that they achieved in minutes, seconds and hundredths of a second. The TimeSet value remains at 00:00.00 for athletes who fail to complete the race. The primary keys in the Athlete and Race relations have been identified in Figure 7 by underlining them. The correct primary key for the RaceEntryAndResult relation has not been identified. 9.1 In Figure 8 below, underline the appropriate attribute name(s) to identify the correct primary key for this relation. [1 mark] Figure 8 RaceEntryAndResult(RaceNumber, AthleteNumber, TimeSet) 9.2 Relations in a database should usually be fully normalised. Define what it means for a database to be fully normalised. [2 marks] 9.3 On the incomplete Entity-Relationship diagram below show the degree of the three relationships that exist between the entities. [2 marks] Athlete RaceEntryAndResult Race Athlete number 27 is to be entered into race number 6. 9.4 Write the SQL commands that are required to make this entry. [2 marks] Figure 7 is repeated below. Figure 7 (repeated) Athlete(AthleteNumber, Forename, Surname, Class, Gender, DateOfBirth) Race(RaceNumber, Gender, Distance, Type, StartTime) RaceEntryAndResult(RaceNumber, AthleteNumber, TimeSet) Athlete number 27 sets a time of 0:18.76 (0 minutes, 18 seconds, 76 hundredths of a second) for race number 6. 9.5 Write the SQL commands that are required to update the athlete’s entry for this race, to store this time in the TimeSet field. [3 marks] The competition organisers want to produce a list of all of the athletes who took part in race number 6 with the athlete who won (set the lowest time) at the top and the other athletes below the winner in the order in which they finished. Only athletes who finished the race should be included in the list. The following information should appear for each athlete: AthleteNumber, Forename, Surname and TimeSet. 9.6 Write an SQL query to produce the list. [5 marks] The database system is to be extended for use in an inter-school athletics league. Users at any school in the county will be able to access the system to input the results of races. It is possible that two users might try to access or update the system at the same time. 9.7 Explain the conditions under which simultaneous access to a database could cause a problem, and how this could be dealt with. [3 marks]