0% found this document useful (0 votes)
20 views

Databases

The document discusses a company database that stores employee and department data. It includes questions about database concepts like the data dictionary, primary and foreign keys, and entity relationship diagrams. It also includes SQL statements to create the database tables and query employee name data.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Databases

The document discusses a company database that stores employee and department data. It includes questions about database concepts like the data dictionary, primary and foreign keys, and entity relationship diagrams. It also includes SQL statements to create the database tables and query employee name data.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

7

3
1. A company uses a relational database, EMPLOYEES, to store data about its employees and
departments.

(a) The company uses a Database Management System (DBMS).

(i) The DBMS has a data dictionary.

Describe what the data dictionary stores.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [2]

(ii) The DBMS has a query processor.

Describe the purpose of a query processor.

...........................................................................................................................................

...........................................................................................................................................

...........................................................................................................................................

..................................................................................................................................... [2]

(b) Relationships are created between tables using primary and foreign keys.

Describe the role of a primary and a foreign key in database relationships.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [2]

© UCLES 2019 9608/13/M/J/19 [Turn over


1
8

(c) In the company:

• An employee can be a manager.


• A department can have several managers and several employees.
• An employee can only belong to one department.

The EMPLOYEES database has three tables:

EMPLOYEE_DATA(EmployeeID, FirstName, LastName, DateOfBirth, Gender,


DepartmentNumber)
DEPARTMENT(DepartmentNumber, DepartmentName)
DEPARTMENT_MANAGER(DepartmentNumber, EmployeeID, role)

Complete the entity-relationship (E-R) diagram for the EMPLOYEES database.

EMPLOYEE_DATA

DEPARTMENT_MANAGER DEPARTMENT

[3]

(d) Give three reasons why the EMPLOYEES database is fully normalised.

1 ................................................................................................................................................

...................................................................................................................................................

2 ................................................................................................................................................

...................................................................................................................................................

3 ................................................................................................................................................

...................................................................................................................................................
[3]

© UCLES 2019 9608/13/M/J/19


2
9

(e) Part of the EMPLOYEE_DATA table is shown.

EmployeeID FirstName LastName DateOfBirth Gender DepartmentNumber


156FJEK Harvey Kim 12/05/1984 Male S1
558RRKL Catriona Moore 03/03/1978 Female F2
388LMDV Oscar Ciao 01/01/1987 Male F2

(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]

© UCLES 2019 9608/13/M/J/19 [Turn over


3
10

(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]

© UCLES 2019 9608/13/M/J/19

4
12

2.6 A relational database, TECHNOLOGY, stores data about the staff in a company and the computer
devices used by the staff.

The database has the following tables:

STAFF(StaffID, FirstName, LastName, DateOfBirth, JobTitle)

DEVICE(DeviceID, Type, DatePurchased, StaffID)

(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’.

SELECT .............................................................. (STAFF.StaffID)

FROM ..............................................................

INNER JOIN DEVICE

.............................................................. STAFF.StaffID = DEVICE.StaffID

WHERE STAFF.FirstName = 'Ali'

.............................................................. STAFF.LastName = 'Khan';


[4]

© UCLES 2022 9618/13/M/J/22


5
13

(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]

(c) The database is in Third Normal Form (3NF).

Complete the table by describing the three normal forms.

Normal Form Description

...............................................................................................

...............................................................................................
First Normal Form (1NF)
...............................................................................................

...............................................................................................

...............................................................................................

...............................................................................................
Second Normal Form (2NF)
...............................................................................................

...............................................................................................

...............................................................................................

...............................................................................................
Third Normal Form (3NF)
...............................................................................................

...............................................................................................
[3]

© UCLES 2022 9618/13/M/J/22 [Turn over


6
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.

The surgery wants to upgrade to a relational database.

(a) Explain the reasons why the surgery should upgrade their database.

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

...................................................................................................................................................

............................................................................................................................................. [4]

(b) The design for the surgery database, SURGERY, is:

PET(PetID, OwnerFirstName, OwnerLastName, PetName, PetBreed,


PetDateOfBirth, TelephoneNumber)

APPOINTMENT(AppointmentID, Date, Time, StaffID, PetID)

(i) Give one reason why the database design for SURGERY is not in Third Normal Form
(3NF).

...........................................................................................................................................

..................................................................................................................................... [1]

© UCLES 2020 9608/11/O/N/20 [Turn over


7
4

(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.

APPOINTMENT(AppointmentID, Date, Time, StaffID, PetID)

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.

AppointmentID Date Time StaffID PetID


222010 02/02/2021 12:40 JK1 20CF
222011 02/02/2021 12:40 PP2 10DT
222012 02/02/2021 12:50 JK1 9RR
222013 02/02/2021 13:00 JK1 7MR

(i) Identify the industry standard language that provides both DML and Data Definition
Language (DDL) statements.

...........................................................................................................................................

..................................................................................................................................... [1]

© UCLES 2020 9608/11/O/N/20 8


5

(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.

SELECT ........................................................ , ........................................................

FROM APPOINTMENT

WHERE ........................................................ AND ........................................................

ORDER BY Time ........................................................ ;


[3]

(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]

© UCLES 2020 9608/11/O/N/20 [Turn over


9
6

(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 ......................................... model has one ......................................... that stores all

the data for the surgery. The other computers are ......................................... . When a

user requests data, a request is sent to the ......................................... .


[4]

(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]

© UCLES 2020 9608/11/O/N/20


10

You might also like