Question 7
AQA Computer Science June 2018 Paper 2A level11 marks
On the specification
- 7.1
- 4.10 Fundamentals of databases
- 7.2
- 4.10 Fundamentals of databases
- 7.3
- 4.10 Fundamentals of databases
- 7.4
- 4.10 Fundamentals of databases
Question text
7 Athletes, who are members of teams, compete in running events, which are held at fixtures throughout the year. For example, athlete 15 might compete in the Girls’ 1500m Under 18 race in the fixture at Marsten on 12 September 2018. A relational database is used to store the details of which athletes enter each event at each fixture. The relations used in the database are shown in Figure 7. Figure 7 Athlete(AthleteID, Surname, Forename, DateOfBirth, Gender, TeamName) EventType(EventTypeID, Gender, Distance, AgeGroup) Fixture(FixtureID, FixtureDate, LocationName) EventAtFixture(FixtureID, EventTypeID) EventEntry(FixtureID, EventTypeID, AthleteID) • Each Athlete, EventType and Fixture is identified by a unique identity number, for example AthleteID for athletes. • An EventType is a type of event, such as Boys’ 100m Under 15 race. • If an athlete wants to take part in an event at a particular fixture, then an entry is created in the EventEntry relation to represent this. 7.1 Figure 8 shows an incomplete entity-relationship diagram for part of the database. box Draw lines on Figure 8 to show the degree of any three relationships that exist between the four entities shown. [2 marks] Figure 8 EventType Fixture EventEntry EventAtFixture 7.2 Figure 9 shows an SQL statement that is intended to make a table to represent the Athlete relation. The statement contains some errors. Figure 9 CREATE TABLE Athlete ( PRIMARY KEY AthleteID, VARCHAR(50) Surname, VARCHAR(30) Forename, DATE DateOfBirth, VARCHAR(6) Gender, VARCHAR(30) TeamName ) You may assume that all of the data types used in Figure 9 are valid and the field lengths are appropriate. State two errors that have been made. [2 marks] Error 1: Error 2: 7.3 State two reasons why database designs, such as this one, are usually normalised. box [2 marks] Reason 1: Reason 2: Figure 7 is repeated below. Figure 7 (repeated) Athlete(AthleteID, Surname, Forename, DateOfBirth, Gender, TeamName) EventType(EventTypeID, Gender, Distance, AgeGroup) Fixture(FixtureID, FixtureDate, LocationName) EventAtFixture(FixtureID, EventTypeID) EventEntry(FixtureID, EventTypeID, AthleteID) A list is to be produced of the names of all athletes who are competing in the fixture that is taking place on 17/09/18. The list must include the Surname, Forename and DateOfBirth of these athletes and no other details. The list should be presented in alphabetical order by Surname. 7.4 Write an SQL query to produce the list. [5 marks]