Question 6
AQA Computer Science June 2019 Paper 2A level14 marks
On the specification
- 6.1
- 4.10 Fundamentals of databases
- 6.2
- 4.10 Fundamentals of databases
- 6.3
- 4.10 Fundamentals of databases
- 6.4
- 4.10 Fundamentals of databases
- 6.5
- 4.10 Fundamentals of databases
Question text
6 A veterinary practice with four different surgeries intends to use a relational database box to store the data that it needs to manage its business. Customers of the practice are pet owners who bring their pets to one of the surgeries for appointments. The surgeries are staffed by vets. • Each customer is identified by a unique identity number and the customer’s forename, surname and telephone number are recorded. • Each pet is identified by a unique identity number and the pet’s name, type and date of birth are recorded. • Each surgery is identified uniquely by its name. The town in which it is located and the surgery’s telephone number are recorded. • Each vet is identified by a unique identity number and the vet’s forename and surname are recorded. A pet is owned by one or more customers and each customer may own any number of pets. Over their lifetimes, pets may attend many appointments. To make an appointment for a pet, a customer contacts a surgery. The appointment is made for the pet to take place on a particular date and time at a specific surgery. Each vet is associated with one surgery which they work at; each surgery is staffed by several vets. 6.1 Complete the entity-relationship diagram below for a fully normalised relational database to store the data required by the veterinary practice. Some of the entities and relationships have been drawn for you. You need to draw the remaining three entities and clearly show the relationships between the entities and their degree. [3 marks] Develop a fully normalised design for a relational database to store the information box 6.2 required by the veterinary practice. To help you, the Pet, Surgery and Vet relations have already been defined in Figure 3. Figure 3 Pet(PetID, PetName, Type, DateOfBirth) Surgery(SurgeryName, Town, TelephoneNumber) Vet(VetID, VetForename, VetSurname, SurgeryName) Using the format shown in Figure 3 list all the other relations that will need to be created, together with the attributes that each will contain. Underline the attribute(s) that will form the entity identifier (primary key) in each relation. [4 marks] 6.3 The SQL query in Figure 4 has been written to produce a list of all of the vets who box work at the surgery in the town of Torquay. Some errors have been made in the query. Figure 4 SELECT VetForename, VetSurname FROM Surgery, Vet WHERE Town = Torquay Describe two errors that have been made in the query. You should not give the omission of a semi-colon (;) as one of the errors. [2 marks] Error 1: Error 2: 6.4 The database is stored at the practice’s head office. Staff at the individual surgeries access it using a client-server database system, which enables the management of concurrent access to the database. Describe an example of a problem that could occur if no system were in place to manage concurrent access to the database. [3 marks] Two methods that can be used to manage concurrent access are: box 6.5 • record locks • timestamp ordering. Select one of these methods and describe how it manages concurrent access. [2 marks] Method selected: How it works: