0% found this document useful (0 votes)
423 views55 pages

Topical Past Paper Questions - Database and Data Modeling - AS CS - Page 1 of 55

Bobby and Kim are discussing databases and whether a file-based approach or relational database is better. Bobby incorrectly claims a file-based approach is usually better. Relational databases allow for relationships between multiple tables through normalization. Bobby has a shop database that will store customer, payment, order and product data. It needs to represent one-to-one, one-to-many, and many-to-many relationships between these entities. A data dictionary stores metadata like field names, data types, descriptions and relationships within a database.

Uploaded by

Hussain Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
423 views55 pages

Topical Past Paper Questions - Database and Data Modeling - AS CS - Page 1 of 55

Bobby and Kim are discussing databases and whether a file-based approach or relational database is better. Bobby incorrectly claims a file-based approach is usually better. Relational databases allow for relationships between multiple tables through normalization. Bobby has a shop database that will store customer, payment, order and product data. It needs to represent one-to-one, one-to-many, and many-to-many relationships between these entities. A data dictionary stores metadata like field names, data types, descriptions and relationships within a database.

Uploaded by

Hussain Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Database and data modeling

Topical past paper questions - Database and data modeling - AS CS - Page 1 of 55


S/21/11/7
Bobby and Kim are discussing databases.
(a) Bobby tells Kim that a file-based approach is usually better than a relational database.

Explain why Bobby is incorrect.

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

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

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

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

B
IS
...................................................................................................................................................

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

ho
(b) Bobby has a shop that sells products to customers. His database will store data about his
customers, their payment details, orders and the products he sells. Customers will have login

Sc
details to access their accounts. The database will update customers’ payment and login
details without keeping any historical records.
rt
(i) Give one example of each of the following relationships from Bobby’s database.
sa

one-to-one
ad
He

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

...........................................................................................................................................
-
d

one-to-many
oo

...........................................................................................................................................
qs

...........................................................................................................................................
Ma

many-to-many
M.

...........................................................................................................................................
s

...........................................................................................................................................
au

[3]
Gh

(ii) Tick (3) one box to identify the relationship that cannot be directly implemented in a
normalised relational database.

Relationship Tick (3)

one-to-one

one-to-many

many-to-many
[1]
Topical past paper questions - Database and data modeling - AS CS - Page 2 of 55
(iii) Bobby wants to name his database SHOPORDERS.

Write a Data Definition Language (DDL) statement to define a new database with the
name SHOPORDERS.

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

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

(c) A database has a data dictionary.

B
IS
Give three items that are stored in a data dictionary.

ol
1 ................................................................................................................................................

ho
2 ................................................................................................................................................

Sc
3 ................................................................................................................................................
rt [3]
sa
ad
He
-
d
oo
qs
Ma
M.
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 3 of 55


S/21/12/1
Raj owns houses that other people rent from him. He has a database that stores details about
the people who rent houses, and the houses they rent. The database, HOUSE_RENTALS, has the
following structure:
CUSTOMER(CustomerID, FirstName, LastName, DateOfBirth, Email)
HOUSE(HouseID, HouseNumber, Road, Town, Bedrooms, Bathrooms)
RENTAL(RentalID, CustomerID, HouseID, MonthlyCost, DepositPaid)

(a) Give the definition of the following database terms, using an example from the database
HOUSE_RENTALS for each definition.

B
IS
Term Definition and example

ol
..............................................................................................................................

ho
Field
..............................................................................................................................

Sc
..............................................................................................................................
rt
..............................................................................................................................
sa

Entity
ad

..............................................................................................................................
He

..............................................................................................................................
-

..............................................................................................................................
d

Foreign key
oo

..............................................................................................................................
qs

..............................................................................................................................
Ma

[6]
M.

(b) Tick (3) one box to identify whether the database HOUSE_RENTALS is in Third Normal Form
(3NF) or not in 3NF.
Justify your choice using one or more examples from the database HOUSE_RENTALS.
s
au
Gh

In 3NF

Not in 3NF

Justification ...............................................................................................................................

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 4 of 55


(c) Example data from the table RENTAL are given:

RentalID CustomerID HouseID MonthlyCost DepositPaid


1 22 15B5L 1000.00 Yes
2 13 3F 687.00 No
3 1 12AB 550.00 Yes
4 3 37 444.50 Yes

B
(i) Complete the following Data Definition Language (DDL) statement to define the table

IS
RENTAL.

ol
CREATE ...................................... ...................................... (

ho
RentalID INTEGER NOT NULL,

Sc
CustomerID INTEGER NOT NULL,
rt
HouseID ...................................... (5) NOT NULL,
sa

MonthlyCost ...................................... NOT NULL,


ad

DepositPaid BOOLEAN NOT NULL,


He

.......................................................... (RentalID)
-

);
d

[4]
oo
qs

(ii) Write a Data Manipulation Language (DML) script to return the first name and last name
of all customers who have not paid their deposit.
Ma

...........................................................................................................................................
M.

...........................................................................................................................................
s

...........................................................................................................................................
au
Gh

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 5 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

W/20/11/2
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.

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

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

B
IS
...................................................................................................................................................

ol
...................................................................................................................................................

ho
...................................................................................................................................................

Sc
...................................................................................................................................................
rt
...................................................................................................................................................
sa

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

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


He

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


-

PetDateOfBirth, TelephoneNumber)
d

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


oo
qs

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

...........................................................................................................................................
M.

..................................................................................................................................... [1]
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 6 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

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

B
IS
...........................................................................................................................................

ol
...........................................................................................................................................

ho
Table 2 ...............................................................................................................................

Sc
...........................................................................................................................................
rt
...........................................................................................................................................
sa

Table 3 ...............................................................................................................................
ad

...........................................................................................................................................
He

...........................................................................................................................................
-

[4]
d

(c) Part of the table APPOINTMENT is shown. The veterinary surgery uses Data Manipulation
oo

Language (DML) statements to search for appointments.


qs

AppointmentID Date Time StaffID PetID


Ma

222010 02/02/2021 12:40 JK1 20CF


M.

222011 02/02/2021 12:40 PP2 10DT


222012 02/02/2021 12:50 JK1 9RR
s
au

222013 02/02/2021 13:00 JK1 7MR


Gh

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 7 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(ii) Write a DDL statement to update the table APPOINTMENT and define AppointmentID
as the primary key.

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

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

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

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

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

ol
SELECT ........................................................ , ........................................................

ho
Sc
FROM APPOINTMENT

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


rt
ORDER BY Time ........................................................ ;
sa

[3]
ad

(d) New pet owners complete a paper-based form to register their pets at the surgery.
He

(i) Describe two verification checks that can be carried out when the data from the paper-
-

based form is entered into the database.


d

1 ........................................................................................................................................
oo
qs

...........................................................................................................................................
Ma

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

...........................................................................................................................................
M.

2 ........................................................................................................................................
s
au

...........................................................................................................................................
Gh

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 8 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

W/20/12/5
A teacher uses a relational database, RESULTS, to store data about her students and their test
results.

(a) Describe the benefits to the teacher of using a relational database instead of a file-based
approach.

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

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

B
...................................................................................................................................................

IS
...................................................................................................................................................

ol
...................................................................................................................................................

ho
Sc
...................................................................................................................................................

...................................................................................................................................................
rt
sa
............................................................................................................................................. [4]
ad

(b) The teacher sets up the RESULTS database using a Database Management System (DBMS).
He

(i) Explain the ways in which the developer interface of a DBMS will help the teacher set up
the database.
-

...........................................................................................................................................
d
oo

...........................................................................................................................................
qs

...........................................................................................................................................
Ma

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

(ii) The DBMS creates a data dictionary for the RESULTS database.
s

Identify three items that will be included in the data dictionary.


au
Gh

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 9 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The RESULTS database has the following structure:

STUDENT(StudentID, FirstName, LastName, Class, TargetGrade)

TEST(TestID, Topic, MaxMarks)

STUDENT_TEST(StudentID, TestID, Mark)

(i) Complete the following table by giving one example of each database term from the
database RESULTS. Give both the field name and the corresponding table name.

B
IS
Database term Field name Table name

ol
Primary key

ho
Sc
Foreign key

Attribute
rt
sa

[3]
ad
He

(ii) Tick (✓) one box to identify whether the database RESULTS is in 1NF, 2NF or 3NF.
Justify your choice.
-

1NF 2NF 3NF


d
oo
qs
Ma

Justification: ......................................................................................................................
M.

...........................................................................................................................................
s

...........................................................................................................................................
au

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

(iii) Complete the Data Manipulation Language (DML) script to display the Student ID, mark
and maximum marks for all tests with the topic of ‘Programming’.

SELECT StudentID, Mark, ........................................................

FROM STUDENT_TEST, ........................................................

........................................................ Topic = "Programming"

AND ........................................................ = ........................................................;


[5]

Topical past paper questions - Database and data modeling - AS CS - Page 10 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(iv) The teacher wants to implement validation to make sure that all data entered into the
database RESULTS are reasonable.

Name three different methods of data validation that can be used in the RESULTS
database. Describe how each method will limit the data that can be entered in this
database.

Method 1 ...........................................................................................................................

Description ........................................................................................................................

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

Method 2 ...........................................................................................................................

B
IS
Description ........................................................................................................................

ol
...........................................................................................................................................

ho
Method 3 ...........................................................................................................................

Sc
Description ........................................................................................................................

rt
...........................................................................................................................................
[6]
sa

(d) The teacher stores the database on the desktop computer in her classroom.
ad

(i) Explain why it is important to keep the database secure.


He

...........................................................................................................................................
-

...........................................................................................................................................
d
oo

...........................................................................................................................................
qs

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

(ii) Explain the ways in which the teacher can use data backup and disk mirroring to limit the
amount of data lost in the event of hardware failure.
M.

Data backup
s

...........................................................................................................................................
au

...........................................................................................................................................
Gh

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

...........................................................................................................................................
Disk mirroring

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

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

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

...........................................................................................................................................
[4]
Topical past paper questions - Database and data modeling - AS CS - Page 11 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S/20/11/7
A driving school teaches people how to drive cars. The school has a relational database,
DRIVING_SCHOOL, to store information about instructors, students, lessons and the cars used by
instructors.

INSTRUCTOR(InstructorID, FirstName, LastName, DateOfBirth, Level)

CAR(Registration, Make, Model, EngineSize)

INSTRUCTOR_CAR(InstructorID, Registration)

B
STUDENT(StudentID, FirstName, LastName, DateOfBirth, Address1)

IS
LESSON(LessonID, StudentID, InstructorID, LessonDate, LessonTime)

ol
(a) Give two benefits to the driving school of using a relational database instead of a flat file.

ho
1 .................................................................................................................................................

Sc
...................................................................................................................................................
rt
2 .................................................................................................................................................
sa
ad

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

(b) Complete the entity-relationship diagram for the database DRIVING_SCHOOL.


-
d
oo

INSTRUCTOR INSTRUCTOR_CAR
qs
Ma
M.
s
au

LESSON CAR
Gh

STUDENT

[4]

Topical past paper questions - Database and data modeling - AS CS - Page 12 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The table shows some sample data for the table INSTRUCTOR.

InstructorID FirstName LastName DateOfBirth Level


Ins01 Jayden Han 05/06/1974 1
Ins02 Freda Choi 06/02/1978 2
Ins03 Kelly Kim 01/12/1966 1
Ins04 Santana Thompson 09/09/1985 3

Complete the Data Definition Language (DDL) statement to create the table INSTRUCTOR.

B
………………………………………………………………………… TABLE INSTRUCTOR(

IS
InstructorID VARCHAR(5),

ol
FirstName VARCHAR(15),

ho
LastName VARCHAR(15),

Sc
DateOfBirth DATE,
rt
Level ………………………………………………………………………… ,
sa

………………………………………………………………………… (InstructorID)
ad

);
He

[3]
-

(d) The table STUDENT needs an additional field to store the student’s telephone number, for
example 012-3456.
d
oo

Write a Data Definition Language (DDL) statement to add the new field to the table STUDENT.
qs

...................................................................................................................................................
Ma

...................................................................................................................................................
M.

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

............................................................................................................................................. [2]
s
au

(e) Write a Data Manipulation Language (DML) statement to return the date and time of all future
Gh

lessons booked with the instructor whose InstructorID is Ins01.

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

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

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

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

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

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

............................................................................................................................................. [4]
Topical past paper questions - Database and data modeling - AS CS - Page 13 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S/20/12/6
A software development company has a relational database, SOFTWARE_MANAGEMENT. The
database stores details of the customers who have purchased software, as well as the software
and licences that customers have purchased.

The SOFTWARE_MANAGEMENT database has the following tables:

CUSTOMER_DETAILS(CustomerID, CompanyName, Address1, Address2, City)

SOFTWARE_PURCHASED(SoftwareName, SoftwareDescription, CustomerID,


LicenceType, LicenceCost, RenewalDate)

B
IS
(a) Explain why this database is not in Third Normal Form (3NF). Refer to the tables in your
answer.

ol
Do not attempt to normalise the tables.

ho
...................................................................................................................................................

Sc
...................................................................................................................................................
rt
...................................................................................................................................................
sa
ad

...................................................................................................................................................
He

...................................................................................................................................................
-

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

(b) Give an example from the database SOFTWARE_MANAGEMENT for each of the following
oo

database terms.
qs

Term Example
Ma

Entity
M.

Foreign key
s
au

Attribute
Gh

[3]

Topical past paper questions - Database and data modeling - AS CS - Page 14 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The company also develops computer games. They extend the relational database
SOFTWARE_MANAGEMENT by adding a new table. The new table, GAME_DEVELOPMENT,
stores details about the games and the software development teams creating them.

The table shows example data in GAME_DEVELOPMENT.

GameName Genre TeamNumber DevelopmentStage ManagerID

Bunny Hop Platform 4 Analysis 23KP

Fried Eggs Retro 2 Programming stage 1 9RTU

B
IS
Create‑a‑game Action 1 Acceptance testing 11TF

ol
(i) Complete the Data Definition Language (DDL) statement to create the table

ho
GAME_DEVELOPMENT.

Sc
CREATE ………………………………………………………… ………………………………………………………… (

GameName VarChar, rt
sa
Genre VarChar,
ad

………………………………………………………… ………………………………………………………… ,
He

DevelopmentStage VarChar,
-

ManagerID VarChar,
d
oo

………………………………………………………… (GameName)
qs

);
[5]
Ma

(ii) Another table, PRODUCT_MANAGER, is created.


M.

PRODUCT_MANAGER(ManagerID, FirstName, LastName)


s
au

Complete the Data Manipulation Language (DML) statement to return the game name,
genre and team number of all games managed by the product manager with the first
Gh

name ‘James’ and the last name ‘Fitz’.

………………………………………………………… GameName, Genre, TeamNumber

FROM GAME_DEVELOPMENT, PRODUCT_MANAGER

WHERE PRODUCT_MANAGER.FirstName = "James"

AND PRODUCT_MANAGER.LastName = "Fitz"

AND …………………………………………………………………………………………………

= …………………………………………………………………………………………………… ;
[3]
Topical past paper questions - Database and data modeling - AS CS - Page 15 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S/20/13/6
Sheila creates a relational database for her hotel using a Database Management System (DBMS).

(a) Draw one line from each database term to its most appropriate description.

Database Term Description

A field in one table that links to a primary key in another table

B
Primary key

IS
A collection of records and fields

ol
ho
Attribute

Sc
The type of data that is being stored

rt
sa

Foreign key A unique identifier for each tuple


ad
He

A data item, represented as a field within a table


-

Entity
d
oo

The concept or object in the system that we want to model


qs

and store information about


Ma

[4]

(b) Identify three tasks that Sheila can perform using the DBMS developer interface.
M.

1 ................................................................................................................................................
s
au

2 ................................................................................................................................................
Gh

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

Topical past paper questions - Database and data modeling - AS CS - Page 16 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) Sheila creates the database HOTEL with the following table structure:

ROOM(RoomNumber, RoomType)

BOOKING(BookingID, RoomNumber, CustomerID, StartDate)

CUSTOMER(CustomerID, FirstName, LastName, Address, Tel_Num)

(i) The following table shows some sample data for the table ROOM.

RoomNumber RoomType

B
1 Standard

IS
2 Double

ol
3 Executive
4 Standard

ho
Sc
Complete the Data Definition Language (DDL) statement to create the table ROOM.

................................................ TABLE ROOM(


rt
sa
RoomNumber Integer,
ad

RoomType ................................................,
He

................................................ (RoomNumber)
-

);
[3]
d

(ii) Room number 5 is a Double room.


oo
qs

Complete the Data Manipulation Language (DML) statement to add the details for room
number 5 to the table ROOM.
Ma

INSERT ................................................ ROOM


M.

VALUES(......................................................................................................);
[2]
s
au

(iii) The table BOOKING needs an additional field to store the number of nights (for example,
3) a customer is staying.
Gh

Write a Data Definition Language (DDL) statement to add the new field to the table
BOOKING.

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

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

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

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

..................................................................................................................................... [2]
Topical past paper questions - Database and data modeling - AS CS - Page 17 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

W/19/11/4
(d) A bank uses a relational database, ACCOUNTS, to store the information about customers
and their accounts.
The database stores the customer’s first name, last name and date of birth.
The bank has several different types of account. Each account type has a unique ID number,
name (for example, regular or saving) and bonus (for example, $5.00, $10.00 or $15.00).
A customer can have more than one account.

Each customer’s account has its own ID number and stores the amount of money the
customer has in that account.

B
The bank creates a normalised, relational database to store the required information. There

IS
are three tables:

ol
• CUSTOMER
• ACCOUNT_TYPE

ho
• CUSTOMER_ACCOUNT

Sc
(i) Write the attributes for each table to complete the database design for the bank.
rt
CUSTOMER( .......................................................................................................................
sa

...........................................................................................................................................
ad

.........................................................................................................................................)
He

ACCOUNT_TYPE( ..............................................................................................................
-

...........................................................................................................................................
d
oo

.........................................................................................................................................)
qs

CUSTOMER_ACCOUNT( ......................................................................................................
Ma

...........................................................................................................................................
M.

.........................................................................................................................................)
[3]
s

(ii) Identify the primary key for each table that you designed in part (d)(i).
au
Gh

CUSTOMER .........................................................................................................................

ACCOUNT_TYPE ................................................................................................................

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

(iii) Identify one foreign key in one of the tables that you designed in part (d)(i).

Table name ........................................................................................................................

Foreign key .......................................................................................................................


[1]

Topical past paper questions - Database and data modeling - AS CS - Page 18 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(iv) The following table has definitions of database terms.

Write the correct database term in the table for each definition.

Definition Term

All the data about one entity

The data in one row of a table

B
IS
A column or field in a table
[3]

ol
ho
Sc
rt
sa
ad
He
-
d
oo
qs
Ma
M.
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 19 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

W/19/12/4
Anushka needs to store information about bookings at a sports club.

(a) Anushka has a file-based storage system. She wants a relational database.

(i) Describe the features of a relational database that address the limitations of Anushka’s
file-based system.

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

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

B
IS
...........................................................................................................................................

ol
...........................................................................................................................................

ho
...........................................................................................................................................

Sc
...........................................................................................................................................
rt
...........................................................................................................................................
sa

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

(ii) The relational database design needs to be normalised. The following statements
He

describe the three stages of database normalisation.

Complete the statements by filling in the missing words.


-
d
oo

For a database to be in First Normal Form (1NF) there must be no ..................................


qs

groups of attributes.
Ma

For a database to be in Second Normal Form (2NF), it must be in 1NF, and contain no
M.

.................................. key dependencies.


s

For a database to be in Third Normal Form (3NF), it must be in 2NF, and all attributes
au

must be fully dependent on the .................................. .................................. .


Gh

[4]

Topical past paper questions - Database and data modeling - AS CS - Page 20 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(b) The normalised relational database, SPORTS_CLUB, has the following table design.

MEMBER(MemberID, FirstName, LastName, MembershipType)

SESSION(SessionID, Description, SessionDate, SessionTime, NumberMembers)

TRAINER(TrainerID, TrainerFirstName, TrainerLastName)

MEMBER_SESSION(MemberID, SessionID)

B
SESSION_TRAINER(SessionID, TrainerID)

IS
(i) Anushka has designed an entity-relationship (E-R) diagram for SPORTS_CLUB.

ol
Complete the entity-relationship (E-R) diagram.

ho
Sc
MEMBER SESSION

rt
sa
ad

MEMBER_SESSION SESSION_TRAINER
He
-
d
oo

TRAINER
qs

[2]
Ma

(ii) Anushka first needs to create the database that she has designed.
M.

Write a Data Definition Language (DDL) statement to create the SPORTS_CLUB


database.
s
au

...........................................................................................................................................
Gh

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

Topical past paper questions - Database and data modeling - AS CS - Page 21 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(iii) The table shows some sample data for the table SESSION.

SessionID Description SessionDate SessionTime NumberMembers


21PL Pilates junior 04/04/2020 18:00 15
13AE Aerobics senior 04/04/2020 19:00 20
Weightlifting
33WG 04/04/2020 10:00 10
advanced

B
IS
Write a DDL script to create the table SESSION.

ol
...........................................................................................................................................

ho
...........................................................................................................................................

Sc
...........................................................................................................................................
rt
...........................................................................................................................................
sa

...........................................................................................................................................
ad

...........................................................................................................................................
He

...........................................................................................................................................
-

...........................................................................................................................................
d
oo

...........................................................................................................................................
qs

..................................................................................................................................... [5]
Ma

(iv) Write a Data Manipulation Language (DML) script to return the first name and last name
of all members who have Peak membership type.
M.

...........................................................................................................................................
s
au

...........................................................................................................................................
Gh

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 22 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

W/19/13/3
A hotel needs to record information about customers and their bookings.

(a) The hotel has two types of room: double and family. Each room has a unique room number.

The hotel stores information about the customers including their name, address and contact
details.

When a customer books a room, they give the start date and the number of nights they want
to stay. If a customer wants more than one room, each room must have a separate booking.
Each booking has an ID number.

B
IS
The hotel creates a normalised, relational database to store the required information. There
are three tables:

ol
• CUSTOMER

ho
• ROOM
• BOOKING

Sc
(i) Complete the database design for the hotel by writing the attributes for each table.
rt
CUSTOMER( .......................................................................................................................
sa

...........................................................................................................................................
ad
He

........................................................................................................................................ )
-

ROOM( ...............................................................................................................................
d
oo

...........................................................................................................................................
qs

........................................................................................................................................ )
Ma

BOOKING( .........................................................................................................................
M.

...........................................................................................................................................
s
au

........................................................................................................................................ )
[3]
Gh

(ii) Identify the primary key for each table that you designed in part (a)(i).

CUSTOMER .........................................................................................................................

ROOM ..................................................................................................................................

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

Topical past paper questions - Database and data modeling - AS CS - Page 23 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(iii) Identify one foreign key in the tables that you designed in part (a)(i).

Table name ........................................................................................................................

Foreign key .......................................................................................................................


[1]

(b) The hotel wants to use a Database Management System (DBMS) to set up and manage the
database.

Describe, using examples, how the hotel can use the following DBMS tools:

B
IS
Developer interface ..................................................................................................................

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

ol
ho
...................................................................................................................................................

Sc
...................................................................................................................................................

...................................................................................................................................................
rt
sa
Query processor .......................................................................................................................
ad

...................................................................................................................................................
He

...................................................................................................................................................
-

...................................................................................................................................................
d
oo

...................................................................................................................................................
[5]
qs

(c) The following table has four SQL scripts.


Ma

Tick (✓) one box in each row to identify whether the script is an example of a Data Definition
M.

Language (DDL) statement or a Data Manipulation Language (DML) statement.


s

Script DDL DML


au
Gh

CREATE TABLE FILMS

SELECT FilmID FROM FILMS

ALTER TABLE FILMS ADD PRIMARY KEY (FilmID)

CREATE DATABASE MYDATA


[2]

Topical past paper questions - Database and data modeling - AS CS - Page 24 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S 19/11/2b (i) (ii), (c)


(b) The software company stores information about customers and the software licences they
have purchased. The company considers a file-based approach for the storage and retrieval
of data.

(i) Give three limitations of a file-based approach to store the data.

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

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

B
IS
2 ........................................................................................................................................

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

ol
ho
3 ........................................................................................................................................

Sc
...........................................................................................................................................
[3]
rt
(ii) The software company decides to use a database to overcome the limitations of a
sa

file-based system. Some of these limitations are addressed through the logical schema.
ad

Name and describe two levels of the schema of a database.


He

Name 1 ..............................................................................................................................
-

Description ........................................................................................................................
d
oo

...........................................................................................................................................
qs

Name 2 ..............................................................................................................................
Ma

Description ........................................................................................................................
M.

...........................................................................................................................................
[4]
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 25 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The database has the following tables:

CUSTOMER(CustomerID, CompanyName)

SOFTWARE(SoftwareID, SoftwareName, OperatingSystem, Description)

LICENCE(LicenceID, CustomerID, SoftwareID, DateOfPurchase,


LicenceType, Cost, ExpiryDate)

(i) Identify the type of relationship that exists between the tables CUSTOMER and LICENCE.

B
IS
...........................................................................................................................................

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

ol
ho
(ii) Describe how the relationship is created between the tables CUSTOMER and LICENCE.

Sc
...........................................................................................................................................

rt
...........................................................................................................................................
sa
...........................................................................................................................................
ad

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

(iii) The company needs a list of all software licences that have an expiry date on or before
31/12/2019.
-
d

Write an SQL query to return the fields CustomerID, SoftwareID, LicenceType,


oo

Cost and ExpiryDate for all licences that expire on, or before 31/12/2019. Group the
output by CustomerID, and in ascending order of cost.
qs

...........................................................................................................................................
Ma

...........................................................................................................................................
M.

...........................................................................................................................................
s
au

...........................................................................................................................................
Gh

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

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

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

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

..................................................................................................................................... [5]

Topical past paper questions - Database and data modeling - AS CS - Page 26 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776
S 19/12/5
Moheem is creating a relational database to store data about his customers.
(a) Moheem has been told a relational database addresses some of the limitations of a file-based
approach by reducing data redundancy.
(i) State what is meant by the term data redundancy.

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

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

(ii) Explain how a relational database can help to reduce data redundancy.

B
...........................................................................................................................................

IS
...........................................................................................................................................

ol
...........................................................................................................................................

ho
...........................................................................................................................................

Sc
...........................................................................................................................................
rt
..................................................................................................................................... [3]
sa

(b) Moheem uses a Database Management System (DBMS) to ensure the security and integrity
ad

of the data.
He

(i) Explain the difference between security and integrity.


-

...........................................................................................................................................
d

...........................................................................................................................................
oo
qs

...........................................................................................................................................
Ma

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

(ii) Name and describe two security features provided by a DBMS.

Feature 1 ...........................................................................................................................
s
au

...........................................................................................................................................
Gh

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

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

Feature 2 ...........................................................................................................................

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 27 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(iii) The DBMS provides software tools for the database developer.

Fill in the names of the missing software tools in the following statements.

A ..................................................................... allows a developer to extract data from a


database.

A ..................................................................... enables a developer to create user-friendly


forms and reports.
[2]

B
IS
S 19/13/3
A company uses a relational database, EMPLOYEES, to store data about its employees and
departments.

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

Sc
(i) The DBMS has a data dictionary.

Describe what the data dictionary stores. rt


sa
...........................................................................................................................................
ad

...........................................................................................................................................
He

...........................................................................................................................................
-

..................................................................................................................................... [2]
d
oo

(ii) The DBMS has a query processor.


qs

Describe the purpose of a query processor.


Ma

...........................................................................................................................................
M.

...........................................................................................................................................
s

...........................................................................................................................................
au

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 28 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

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

B
DEPARTMENT_MANAGER(DepartmentNumber, EmployeeID, role)

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

ol
ho
EMPLOYEE_DATA

Sc
rt
sa
ad
He

DEPARTMENT_MANAGER DEPARTMENT
-
d
oo

[3]
qs

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

1 ................................................................................................................................................
M.

...................................................................................................................................................
s

2 ................................................................................................................................................
au

...................................................................................................................................................
Gh

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 29 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

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

B
...........................................................................................................................................

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

ol
(ii) Write a DDL statement to define the table EMPLOYEE_DATA, and declare EmployeeID

ho
as the primary key.

Sc
...........................................................................................................................................
rt
...........................................................................................................................................
sa

...........................................................................................................................................
ad

...........................................................................................................................................
He

...........................................................................................................................................
-

...........................................................................................................................................
d
oo

...........................................................................................................................................
qs

...........................................................................................................................................
Ma

...........................................................................................................................................
M.

..................................................................................................................................... [5]
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 30 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

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

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

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

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

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

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

B
IS
...........................................................................................................................................

ol
...........................................................................................................................................

ho
...........................................................................................................................................

Sc
...........................................................................................................................................
rt
..................................................................................................................................... [5]
sa
ad
He
-
d
oo
qs
Ma
M.
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 31 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

W 18/11/7
A movie theatre has a relational database that stores the movie schedule, and information about
the movies. The theatre has several screens that play movies at the same time.

The database has three tables to store information about the movies, the screens and the movie
schedule.

MOVIE(MovieID, Title, Length, Rating)

SCREEN(ScreenNumber, NumberSeats)

MOVIESCHEDULE(ScheduleID, MovieID, ScreenNumber, Time)

B
IS
(a) Complete the entity-relationship (E-R) diagram to show the relationships between these
tables.

ol
ho
Sc
MOVIE SCREEN
rt
sa
ad
He

MOVIESCHEDULE
-
d
oo

[2]
qs
Ma

(b) Explain how primary and foreign keys are used to link the tables in the movie theatre
database.
M.

...................................................................................................................................................
s

...................................................................................................................................................
au

...................................................................................................................................................
Gh

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

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 32 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The database needs to store the name of the company that produced each movie, for
example, Rocking Movies.

Write an SQL script to add the attribute ProductionCompany to the MOVIE table.

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

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

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

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

B
IS
...............................................................................................................................................[2]

ol
(d) Write an SQL script to display the title and rating of all movies scheduled to play on screen

ho
number 3.

Sc
...................................................................................................................................................

...................................................................................................................................................
rt
sa
...................................................................................................................................................
ad

...................................................................................................................................................
He

...................................................................................................................................................
-

...................................................................................................................................................
d
oo

...................................................................................................................................................
qs

...................................................................................................................................................
Ma

...................................................................................................................................................
M.

...............................................................................................................................................[4]
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 33 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S 18/12/7
A social media website has a relational database, WEBDATA, that stores the site’s information.

The database has three tables to store users’ details, and details of the images and text that they
post.

USER(UserName, FirstName, SecondName, DateOfBirth)


PHOTO(PhotoID, UserName, Comment, UploadDate)
TEXTPOST(PostID, UserName, DateOfPost, TheText)

(a) (i) Explain how the relationship between the tables USER and PHOTO has been implemented.

B
IS
...........................................................................................................................................

ol
...........................................................................................................................................

ho
...........................................................................................................................................

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

(ii)
rt
Draw the entity-relationship (E-R) diagram to show the relationships between the three
tables.
sa
ad
He
-
d
oo
qs
Ma
M.

[2]
s

(b) A database administrator decides to enforce referential integrity.


au
Gh

Use an example from the database WEBDATA to explain what is meant by referential
integrity.

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

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

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

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

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

...............................................................................................................................................[3]
Topical past paper questions - Database and data modeling - AS CS - Page 34 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The database has been normalised to Third Normal Form (3NF).

Define the three stages of database normalisation.

1NF ............................................................................................................................................

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

2NF ............................................................................................................................................

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

B
3NF ............................................................................................................................................

IS
...................................................................................................................................................

ol
[3]

ho
(d) The following shows sample data from the USER table.

Sc
UserName FirstName SecondName DateOfBirth

gem123 John
rt Smith 01/01/1995
sa

purpleSky Muhammed Ali 23/02/1956


ad

OpenWindow Sunny Amir 03/03/1997


He

bluebird127 Raziya Bello 04/03/1982


-
d

(i) Write an SQL script to create the USER table.


oo

...........................................................................................................................................
qs
Ma

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

...........................................................................................................................................
M.

...........................................................................................................................................
s
au

...........................................................................................................................................
Gh

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

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

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

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

.......................................................................................................................................[5]

Topical past paper questions - Database and data modeling - AS CS - Page 35 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(ii) The database administrator needs to alter the USER table. A new field, Country, needs
to be added.

Write an SQL script to add the field Country to the USER table.

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

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

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

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

B
IS
S 18/13/2

ol
A company writes applications (apps) for smartphones. The company has a relational
database, PURPLEGAME, which stores the information for one of its online game apps.

ho
The database has three tables to store player’s details, dates when they have logged into the app

Sc
and in-app purchase details.

LOGIN(LoginID, PlayerID, Date) rt


sa

PURCHASE(PurchaseID, PlayerID, PurchaseDate, Cost)


ad

PLAYER(PlayerID, PlayerName, SkillLevel)


He

(a) Draw the entity-relationship (E-R) diagram to show the relationships between the three tables.
-
d
oo
qs
Ma
M.

[2]
s
au

(b) The database manager is concerned about data integrity.


Gh

State what is meant by data integrity. Give an example of how the manager can ensure data
integrity in the PURPLEGAME database.

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

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 36 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The database designer states that the PURPLEGAME database is in Third Normal Form (3NF).

Tick (3) one box to indicate whether this statement is true or false.

True False

Justify your choice.

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

B
...................................................................................................................................................

IS
...................................................................................................................................................

ol
...................................................................................................................................................

ho
Sc
...................................................................................................................................................

...............................................................................................................................................[3]
rt
sa
(d) (i) The following table shows some sample data for the PLAYER table.
ad

PlayerID PlayerName SkillLevel


He

fly918 Kylie 3
elephant11 Mehrdad 9
-

candy22 Suzi 15
d
oo

greenGrass Jason 22
qs

Write an SQL script to create the PLAYER table.


Ma

...........................................................................................................................................
M.

...........................................................................................................................................
s
au

...........................................................................................................................................
Gh

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

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

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

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

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

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

.......................................................................................................................................[5]
Topical past paper questions - Database and data modeling - AS CS - Page 37 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(ii) The table, PLAYER, needs to be altered. A new field, DateOfBirth, needs to be added.

Write an SQL script to add the DateOfBirth field to the PLAYER table.

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

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

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

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

B
IS
W 17/11/3
A Local Area Network is used by staff in a hospital to access data stored in a Database Management

ol
System (DBMS).

ho
(a) Name two security measures to protect computer systems.

Sc
1 ................................................................................................................................................
rt
2 ................................................................................................................................................
sa
[2]
ad

(b) A frequent task for staff is to key in new patient data from a paper document. The document
He

includes the patient’s personal ID number.

(i) The Patient ID is a seven digit number. The database designer decides to use a check
-

digit to verify each foreign key value that a user keys in for a Patient ID.
d
oo

When a user assigns a primary key value to a Patient ID, the DBMS adds a modulus-11
check digit as an eighth digit. The DBMS uses the weightings 6, 5, 4, 3, 2 and 1 for
qs

calculating the check digit. It uses 6 as the multiplier for the most significant (leftmost)
digit.
Ma

Show the calculation of the check digit for the Patient ID with the first six digits 786531.
M.
s
au
Gh

Complete Patient ID ......................................................................................................[4]

Topical past paper questions - Database and data modeling - AS CS - Page 38 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(ii) Name and describe two validation checks that the DBMS could carry out on each
primary key value that a user keys in for a Patient ID.

1 Validation check .........................................................................................................

Description .................................................................................................................

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

2 Validation check .........................................................................................................

Description .................................................................................................................

B
....................................................................................................................................

IS
[4]
W/17/11/7

ol
A clinic is staffed by several doctors. The clinic serves thousands of patients. Each day and at any

ho
one time, there is only one doctor in the clinic available for appointments.

Sc
The clinic stores patient, doctor and appointment data in a relational database.

(a) (i) rt
Underline the primary key for each table in the following suggested table designs.
sa
PATIENT(PatientID, PatientName, Address, Gender)
ad

DOCTOR(DoctorID, Gender, Qualification)


He

APPOINTMENT(AppointmentDate, AppointmentTime, DoctorID, PatientID)


[2]
-
d

(ii) Complete the following entity-relationship (E-R) diagram for this design.
oo
qs
Ma
M.
s
au
Gh

[2]

(b) The doctors are concerned that many patients make appointments but do not attend them.

Describe the changes to the table designs that could be made to store this information.

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 39 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The doctors are about to set up a new clinic in the neighbouring village, SITE-B.

The original location is identified as SITE-A.

A new table is designed to store the ID of the doctor who is able to work at each site.

DOCTOR-AVAILABILITY(DoctorID, Site)

Five entries stored in the table are:

DoctorID Site

B
098 SITE-A

IS
074 SITE-A
117 SITE-B

ol
098 SITE-B

ho
033 SITE-B

Sc
(i) State what this data shows about the availability of the doctor with the ID of 098.
rt
...........................................................................................................................................
sa
ad

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

(ii) Opening a new clinic in the neighbouring village will not require any additional table for
storing appointments. It will need a change to the existing appointment table design.
-

Show the revised APPOINTMENT table.


d
oo

APPOINTMENT( ................................................................................................................
qs

................................................................................................................................... ) [1]
Ma

(d) The doctor with the ID of 117 has recently been allocated a new DoctorID of 017.
M.

(i) Write an SQL script to update this doctor’s record in the database.
s

UPDATE .............................................................................................................................
au

SET .....................................................................................................................................
Gh

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

(ii) Describe why this update could cause problems with the existing data stored.

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 40 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(e) Write an SQL script to display the date and time of all appointments made by the patient with
the PatientID of 556.

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

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

...............................................................................................................................................[3]
W 17/12/7
A company takes customer service for its clients very seriously.

The client

B
IS
• The client names are unique.
A visit

ol
• The company arranges a date for a visit to gather feedback from a client.

ho
• A visit to a client never takes more than one day.

Sc
• Over time, the client receives many visits.
Staff (Interviewers)
• One or more staff attend the visit.
rt
sa
• If there is more than one staff member visiting, each performs a separate interview.
ad

Interviews

He

Each interview is classified as either ‘general’ or by some specialism, for example, marketing,
customer service or sales.

-

A report is produced for each interview, InterviewText.


• Each interview is conducted by a single staff member.
d
oo

The client, visit, staff and interview data will be stored in a relational database.
qs

(a) (i) Underline the primary key for each table in the following suggested table designs.
Ma

STAFF(StaffID, StaffName, Department)


M.

CLIENT(ClientName, Address, Town)


s
au

VISIT(ClientName, VisitDate)
Gh

INTERVIEW(ClientName, VisitDate, StaffID, SpecialistFocus, InterviewText)


[3]

(ii) For each of the pairs of entities, A, B and C, draw the relationship between the two
entities.

A CLIENT VISIT

B VISIT INTERVIEW

C INTERVIEW STAFF
Topical past paper questions - Database and data modeling - AS CS - Page 41 of 55 [3]
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(b) The company decides to produce a visit report, VisitReportText, for each visit made.

This text will be produced from the one or more interview texts obtained at the visit.

State how one or more of the given table designs can be changed to add this attribute.

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

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

(c) Client ABC Holdings are now trading under the name of Albright Holdings.

B
(i) Write an SQL script to update this client’s record in the database.

IS
UPDATE .............................................................................................................................

ol
SET ....................................................................................................................................

ho
WHERE ...............................................................................................................................

Sc
[3]
(ii) Describe why this update could cause problems with the existing data stored.
rt
...........................................................................................................................................
sa
ad

...........................................................................................................................................
He

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

(d) Write an SQL script to display the Staff ID of each member of staff who performed an interview
when they visited New Age Toys on 13/10/2016.
d
oo

...................................................................................................................................................
qs

...................................................................................................................................................
Ma

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

(e) At present, all interviews are performed in the UK. Many clients now operate in other countries
in Europe. The company wants to perform interviews with the client’s staff in other countries.
s

Not all interview staff are willing to travel outside of the UK.
au

State how one or more of the table designs should be revised to store this information.
Gh

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 42 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S 17/11/1
A hospital is divided into two areas, Area A and Area B. Each area has several wards. All the ward
names are different.

A number of nurses are based in Area A. These nurses always work on the same ward. Each
nurse has a unique Nurse ID of STRING data type.

A-NURSE A-WARD

(a) Describe the relationship shown above.

B
...................................................................................................................................................

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

ol
(b) A relational database is created to store the ward and nurse data. The two table designs for

ho
Area A are:

Sc
A-WARD(WardName, NumberOfBeds)
rt
A-NURSE(NurseID, FirstName, FamilyName, ...........................................................)
sa

(i) Complete the design for the A-NURSE table. [1]


ad

(ii) Explain how the relationship in part (a) is implemented.


He

...........................................................................................................................................
-

...........................................................................................................................................
d
oo

...........................................................................................................................................
qs

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

(c) In Area B of the hospital, there are a number of wards and a number of nurses.
M.

Each Area B ward has a specialism.


s

Each Area B nurse has a specialism.


au
Gh

A nurse can be asked to work in any of the Area B wards where their specialism matches with
the ward specialism.

The relationship for Area B of the hospital is:

B-NURSE B-WARD

(i) Explain what the degree of relationship is between the entities B-NURSE and B-WARD.

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

.......................................................................................................................................[1]
Topical past paper questions - Database and data modeling - AS CS - Page 43 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(ii) The design for the Area B data is as follows:

B-NURSE(NurseID, FirstName, FamilyName, Specialism)

B-WARD(WardName, NumberOfBeds, Specialism)

B-WARD-NURSE( ............................................................................................................ )

Complete the attributes for the third table. Underline its primary key. [2]

(iii) Draw the relationships on the entity-relationship (E-R) diagram.

B
IS
B-NURSE B-WARD

ol
ho
Sc
B-WARD-NURSE
rt [2]
sa

(d) Use the table designs in part (c)(ii).


ad

(i) Write an SQL query to display the Nurse ID and family name for all Area B nurses with a
He

specialism of ‘THEATRE’.
-

...........................................................................................................................................
d

...........................................................................................................................................
oo
qs

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

(ii) Fatima Woo is an Area B nurse with the nurse ID of 076. She has recently married, and
her new family name is Chi.
M.

Write an SQL command to update her record.


s

UPDATE .............................................................................................................................
au
Gh

SET ....................................................................................................................................

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

Topical past paper questions - Database and data modeling - AS CS - Page 44 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776
S 17/12/1
Some shops belong to the Rainbow Retail buying group. They buy their goods from one or more
suppliers.

Each shop has:

• a unique shop ID
• a single retail specialism (for example, food, electrical, garden).

Each supplier has:

• a unique supplier ID
• a similar single specialism recorded.

B
IS
Rainbow Retail creates a relational database to record data about the shops and their suppliers.

The entity-relationship (E-R) diagram for the relationship between the SHOP and SUPPLIER tables

ol
is shown.

ho
Sc
SHOP SUPPLIER

rt
(a) Explain what the degree of relationship is between the entities SHOP and SUPPLIER.
sa

...................................................................................................................................................
ad
He

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

The database design is as follows:


-
d

SHOP(ShopID, ShopName, Location, RetailSpecialism)


oo

SUPPLIER(SupplierID, SupplierName, ContactPerson, RetailSpecialism)


qs

SHOP-SUPPLIER(ShopID, SupplierID)
Ma

The SHOP–SUPPLIER table stores the suppliers that each shop has previously used.
M.

Primary keys are not shown.


s
au

(b) (i) Label the entities and draw the relationships to complete the revised E-R diagram.
Gh

SUPPLIER

[3]

Topical past paper questions - Database and data modeling - AS CS - Page 45 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(ii) Complete the following table to show for each database table:

• the primary key


• the foreign key(s) (if any):
° Each table may contain none, one or more foreign key(s).
° For a table with no foreign key, write ‘None’.
• an explanation for the use of any foreign key.

Table Primary key Foreign key(s) Explanation


(if any)

SHOP

B
IS
SUPPLIER

ol
ho
SHOP–SUPPLIER

Sc
[5]
rt
(iii) The database designer has implemented SUPPLIER.ContactPerson as a secondary
sa

key.
ad

Describe the reason for this.


He

...........................................................................................................................................
-

...........................................................................................................................................
d
oo

...........................................................................................................................................
qs

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

(c) (i) Write an SQL query to display the shop ID and location of all shops with a ‘GROCERY’
specialism.
M.

...........................................................................................................................................
s
au

...........................................................................................................................................
Gh

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

(ii) The existing shop with ID 8765 has just used the existing supplier SUP89 for the first
time.

Write an SQL script to add this data to the database.

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 46 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

W 16/11/1
(a) Five descriptions and seven relational database terms are shown below.

Draw a line to link each description to its correct database term.

Description Database term

Any object, person or thing about which


it is possible to store data
Secondary key

B
IS
Candidate key
Dataset organised in rows and columns;

ol
the columns form the structure and the
rows form the content

ho
Entity

Sc
Any attribute or combination of attributes rt Foreign key
that can act as a unique key
sa
ad

Primary key
He

Attribute(s) in a table that link to the


-

primary key in another table to form a


relationship Table
d
oo
qs

Tuple
Ma

Attribute or combination of attributes that


is used to uniquely identify a record
M.

[5]
s

(b) Explain what is meant by referential integrity.


au
Gh

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

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

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

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 47 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

W 16/12/9
A health club offers classes to its members. A member needs to book into each class in advance.

(a) The health club employs a programmer to update the class booking system. The programmer
has to decide how to store the records. The choice is between using a relational database or
a file-based approach.

Give three reasons why the programmer should use a relational database.

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

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

B
IS
...................................................................................................................................................

ol
...................................................................................................................................................

ho
2 ................................................................................................................................................

Sc
...................................................................................................................................................
rt
...................................................................................................................................................
sa

...................................................................................................................................................
ad

3 ................................................................................................................................................
He

...................................................................................................................................................
-

...................................................................................................................................................
d
oo

...............................................................................................................................................[6]
qs

(b) The programmer decides to use three tables: MEMBER, BOOKING and CLASS.
Ma

Complete the Entity-Relationship (E-R) diagram to show the relationships between these
M.

tables.
s
au

MEMBER CLASS
Gh

BOOKING

[2]

Topical past paper questions - Database and data modeling - AS CS - Page 48 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) The CLASS table has primary key ClassID and stores the following data:

ClassID Description StartDate ClassTime NoOfSessions AdultsOnly

DAY01 Yoga beginners 12/01/2016 11:00 5 TRUE

EVE02 Yoga beginners 12/01/2016 19:00 5 FALSE

B
IS
DAY16 Circuits 30/06/2016 10:30 4 FALSE

ol
Write an SQL script to create the CLASS table.

ho
...................................................................................................................................................

Sc
...................................................................................................................................................
rt
...................................................................................................................................................
sa

...................................................................................................................................................
ad
He

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

...................................................................................................................................................
-
d

...................................................................................................................................................
oo

...................................................................................................................................................
qs
Ma

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

...............................................................................................................................................[6]
M.
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 49 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S 16/11/8
A school stores a large amount of data. This includes student attendance, qualification, and
contact details. The school’s software uses a file-based approach to store this data.

(a) The school is considering changing to a DBMS.

(i) State what DBMS stands for.

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

(ii) Describe two ways in which the Database Administrator (DBA) could use the DBMS

B
software to ensure the security of the student data.

IS
1 ........................................................................................................................................

ol
...........................................................................................................................................

ho
...........................................................................................................................................

Sc
...........................................................................................................................................
rt
2 ........................................................................................................................................
sa

...........................................................................................................................................
ad
He

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

.......................................................................................................................................[4]
-
d

(iii) A feature of the DBMS software is a query processor.


oo

Describe how the school secretary could use this software.


qs
Ma

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

...........................................................................................................................................
M.

...........................................................................................................................................
s
au

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

(iv) The DBMS has replaced software that used a file-based approach with a relational
database.

Describe how using a relational database has overcome the previous problems
associated with a file-based approach.

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

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

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

.......................................................................................................................................[3]
Topical past paper questions - Database and data modeling - AS CS - Page 50 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(b) The database design has three tables to store the classes that students attend.

STUDENT(StudentID, FirstName, LastName, Year, TutorGroup)

CLASS(ClassID, Subject)

CLASS-GROUP(StudentID, ClassID)

Primary keys are not shown.

There is a one-to-many relationship between CLASS and CLASS–GROUP.

B
IS
(i) Describe how this relationship is implemented.

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

ol
ho
...........................................................................................................................................

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

(ii) Describe the relationship between CLASS-GROUP and STUDENT.


sa
rt
.......................................................................................................................................[1]
ad

(iii) Write an SQL script to display the StudentID and FirstName of all students who are
in the tutor group 10B. Display the list in alphabetical order of LastName.
He

...........................................................................................................................................
-

...........................................................................................................................................
d
oo

...........................................................................................................................................
qs

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

(iv) Write an SQL script to display the LastName of all students who attend the class whose
M.

ClassID is CS1.

...........................................................................................................................................
s
au

...........................................................................................................................................
Gh

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

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

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

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

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

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

Topical past paper questions - Database and data modeling - AS CS - Page 51 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S 16/13/5(a)
(a) A Database Management System (DBMS) provides the following features.

Draw a line to match each feature with its description.

Feature Description

A file or table containing all the details of the


database design
Data dictionary

B
IS
ol
Data design features to ensure the validity
of data in the database

ho
Sc
Data security

rt A model of what the database will look like,


although it may not be stored in this way
sa
ad
He

Data integrity Methods of protecting the data including


the uses of passwords and different access
-

rights for different users of the database


d
oo

[3]
qs
Ma
M.
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 52 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

S 15/11/9
A database has been designed to store data about salespersons and the products they have sold.

The following facts help to define the structure of the database:

• each salesperson works in a particular shop


• each salesperson has a unique first name
• each shop has one or more salespersons
• each product which is sold is manufactured by one company only
• each salesperson can sell any of the products
• the number of products that each salesperson has sold is recorded

B
IS
The table ShopSales was the first attempt at designing the database.

ol
FirstName Shop ProductName NoOfProducts Manufacturer

ho
Nick TX television set 3 SKC
refrigerator 2 WP

Sc
digital camera 6 HKC
Sean BH hair dryer rt 1 WG
electric shaver 8 BG
sa
John TX television set 2 SKC
ad

mobile phone 8 ARC


digital camera 4 HKC
He

toaster 3 GK
-

(a) State why the table is not in First Normal Form (1NF).
d
oo

...................................................................................................................................................
qs

...............................................................................................................................................[1]
Ma
M.
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 53 of 55


Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(b) The database design is changed to:

SalesPerson (FirstName, Shop)

SalesProducts (FirstName, ProductName, NoOfProducts, Manufacturer)

Using the data given in the first attempt table (ShopSales), show how these data are now
stored in the revised table designs.

Table: SalesPerson

FirstName Shop

B
IS
ol
ho
Sc
rt
Table: SalesProducts
sa

FirstName ProductName NoOfProducts Manufacturer


ad
He
-
d
oo
qs
Ma
M.
s
au
Gh

[3]
Topical past paper questions - Database and data modeling - AS CS - Page 54 of 55
Compiled by: Ghaus M. Maqsood - Headstart School - 03009816776

(c) (i) A relationship between the two tables has been implemented.

Explain how this has been done.

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

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

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

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

B
IS
.......................................................................................................................................[2]

(ii) Explain why the SalesProducts table is not in Third Normal Form (3NF).

ol
ho
...........................................................................................................................................

Sc
...........................................................................................................................................

rt
...........................................................................................................................................
sa
.......................................................................................................................................[2]
ad

(iii) Write the table definitions to give the database in 3NF.


He

...........................................................................................................................................
-

...........................................................................................................................................
d
oo

...........................................................................................................................................
qs

.......................................................................................................................................[2]
Ma
M.
s
au
Gh

Topical past paper questions - Database and data modeling - AS CS - Page 55 of 55

You might also like