Databases
Databases
3
1. A company uses a relational database, EMPLOYEES, to store data about its employees and
departments.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(b) Relationships are created between tables using primary and foreign keys.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
EMPLOYEE_DATA
DEPARTMENT_MANAGER DEPARTMENT
[3]
(d) Give three reasons why the EMPLOYEES database is fully normalised.
1 ................................................................................................................................................
...................................................................................................................................................
2 ................................................................................................................................................
...................................................................................................................................................
3 ................................................................................................................................................
...................................................................................................................................................
[3]
(i) Write a Data Definition Language (DDL) statement to create the EMPLOYEES database.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Write a DDL statement to define the table EMPLOYEE_DATA, and declare EmployeeID
as the primary key.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [5]
(iii) Write a Data Manipulation Language (DML) statement to return the first name and last
name of all female employees in the department named Finance.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [5]
4
12
2.6 A relational database, TECHNOLOGY, stores data about the staff in a company and the computer
devices used by the staff.
(a) Describe the relationship between the two tables. Refer to the primary and foreign keys in
your answer.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(b) The database uses a Data Definition Language (DDL) and Data Manipulation Language
(DML).
(i) Complete the SQL script to return the number of devices stored in the database for the
staff member with the first name ‘Ali’ and last name ‘Khan’.
FROM ..............................................................
(ii) The table DEVICE needs a new attribute to store whether the device has been returned
by the staff member, or not.
Write a Structured Query Language (SQL) script to insert the new attribute into the table
DEVICE.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
...............................................................................................
...............................................................................................
First Normal Form (1NF)
...............................................................................................
...............................................................................................
...............................................................................................
...............................................................................................
Second Normal Form (2NF)
...............................................................................................
...............................................................................................
...............................................................................................
...............................................................................................
Third Normal Form (3NF)
...............................................................................................
...............................................................................................
[3]
2
3. A veterinary surgery cares for sick animals. The surgery has a file-based database that stores
data about the pets, their owners, and appointments made with the surgery.
(a) Explain the reasons why the surgery should upgrade their database.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [4]
(i) Give one reason why the database design for SURGERY is not in Third Normal Form
(3NF).
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) The database needs to be normalised to 3NF. A pet may have more than one owner and
an owner may have more than one pet.
The appointment table does not need to change and has been repeated below.
Give the name and attributes of three additional tables in 3NF. Identify the primary
key(s) in each table.
Table 1 ...............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Table 2 ...............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
Table 3 ...............................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[4]
(c) Part of the table APPOINTMENT is shown. The veterinary surgery uses Data Manipulation
Language (DML) statements to search for appointments.
(i) Identify the industry standard language that provides both DML and Data Definition
Language (DDL) statements.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Write a DDL statement to update the table APPOINTMENT and define AppointmentID
as the primary key.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(iii) Complete the DML script to display the times and Pet IDs of all appointments on
02/02/2021 with staff ID of ‘JK1’, in descending order of time.
FROM APPOINTMENT
(d) New pet owners complete a paper-based form to register their pets at the surgery.
(i) Describe two verification checks that can be carried out when the data from the paper-
based form is entered into the database.
1 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
2 ........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[4]
(ii) Appointments can be booked between 09:00 and 16:50 on Monday to Friday.
Describe the ways in which the appointment date and time can be validated to make
sure they are reasonable.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
(e) The surgery has five computers that can all access the database. A copy of the database is
stored centrally.
(i) Complete the description of this type of network model by filling in the missing terms.
the data for the surgery. The other computers are ......................................... . When a
(ii) The surgery wants to keep all data secure. The surgery network is not connected to the
Internet.
Identify two authentication techniques the surgery could use to restrict access to the
data.
1 ........................................................................................................................................
2 ........................................................................................................................................
[2]