Question 7
AQA Computer Science June 2022 Paper 2 (7517/2)A level15 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 A network of zoos uses a relational database system to store information about the animals that they have so that they can be matched up with animals at other zoos in a breeding programme. Figure 5 shows the structure of the relations in the database. Figure 5 Zoo(ZooName, Town, Country) AnimalLocation(AnimalID, ZooName, DateArrived, DateLeft) Animal(AnimalID, IndividualName, Species, DateOfBirth, Sex) Match(AnimalFemaleID, AnimalMaleID, DateOfMatch, Successful) • The Zoo relation stores details of the zoos that participate in the breeding programme. Each zoo is uniquely identified by its ZooName. • The AnimalLocation relation identifies which zoos each animal has lived at. The zoo that the animal is currently at can be identified because the DateLeft attribute is set to 01/01/0001 to indicate that the animal has not left. • The Animal relation stores details of the individual animals that are available to be matched with other animals for breeding. Each animal is identified by a unique number, the AnimalID. The individual name of the animal (eg ‘Timothy’) is also stored, together with the species of the animal (eg ‘Red Panda’), its date of birth and its sex (‘Male’ or ‘Female’). • The Match relation stores details of matches that have been made. The attributes AnimalFemaleID and AnimalMaleID refer to the AnimalID values of the two matched animals in the Animal relation. 7.1 Shade one lozenge to identify which of the properties below does not have to be true for a fully normalised database. [1 mark] A Each attribute in a relation is dependent on the primary key. Each attribute in a relation is dependent only on the primary key; it is not B also dependent on any other attribute in the relation. C The primary key in each relation consists of only one attribute. D There are no repeating groups (or equivalently each attribute is atomic). 7.2 Figure 6 is an incomplete entity-relationship diagram for part of the database shown in Figure 5. Draw lines on Figure 6 to indicate the degree of the two relationships between the three entities shown in the entity-relationship diagram. [2 marks] Figure 6 7.3 Complete the following SQL statement to create the Animal relation, including the key field. [3 marks] CREATE TABLE Animal ( ) 7.4 Figure 5 is repeated below to help you answer Question 07.4 without having to turn back in the question paper. Figure 5 (repeated) Zoo(ZooName, Town, Country) AnimalLocation(AnimalID, ZooName, DateArrived, DateLeft) Animal(AnimalID, IndividualName, Species, DateOfBirth, Sex) Match(AnimalFemaleID, AnimalMaleID, DateOfMatch, Successful) There is a requirement to identify all of the red pandas that were present at the zoo called ‘Ashdale Park’ at any time between 01/04/2020 and 31/05/2020, inclusive. The animals might still be at the zoo or may have moved to another zoo. Write a query that will list all the red pandas that were at the zoo on any day between these dates. For each red panda on the list, the animal’s individual name and the date that the animal arrived at the zoo, and no other fields, should be listed. [7 marks] 7.5 It is proposed that an additional attribute, ZooName, is added to the Animal relation. This will store the name of the zoo that currently has the animal. No other changes would be made to the database. Describe one advantage and one disadvantage of adding this new attribute to the relation. [2 marks] Advantage Disadvantage