Topical Past Paper Questions - Database and Data Modeling - AS CS - Page 1 of 55
Topical Past Paper Questions - Database and Data Modeling - AS CS - Page 1 of 55
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
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.
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]
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
(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]
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
.......................................................... (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]
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.
(a) Explain the reasons why the surgery should upgrade their database.
...................................................................................................................................................
...................................................................................................................................................
B
IS
...................................................................................................................................................
ol
...................................................................................................................................................
ho
...................................................................................................................................................
Sc
...................................................................................................................................................
rt
...................................................................................................................................................
sa
............................................................................................................................................. [4]
ad
PetDateOfBirth, TelephoneNumber)
d
(i) Give one reason why the database design for SURGERY is not in Third Normal Form
(3NF).
Ma
...........................................................................................................................................
M.
..................................................................................................................................... [1]
s
au
Gh
(ii) The database needs to be normalised to 3NF. A pet may have more than one owner and
an owner may have more than one pet.
The appointment table does not need to change and has been repeated below.
Give the name and attributes of three additional tables in 3NF. Identify the primary
key(s) in each table.
Table 1 ...............................................................................................................................
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
(i) Identify the industry standard language that provides both DML and Data Definition
Language (DDL) statements.
...........................................................................................................................................
..................................................................................................................................... [1]
(ii) Write a DDL statement to update the table APPOINTMENT and define AppointmentID
as the primary key.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
..................................................................................................................................... [2]
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
[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-
-
1 ........................................................................................................................................
oo
qs
...........................................................................................................................................
Ma
...........................................................................................................................................
...........................................................................................................................................
M.
2 ........................................................................................................................................
s
au
...........................................................................................................................................
Gh
...........................................................................................................................................
...........................................................................................................................................
[4]
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
1 ........................................................................................................................................
2 ........................................................................................................................................
3 ........................................................................................................................................
[3]
(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.
-
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’.
(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
...........................................................................................................................................
-
...........................................................................................................................................
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_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
INSTRUCTOR INSTRUCTOR_CAR
qs
Ma
M.
s
au
LESSON CAR
Gh
STUDENT
[4]
(c) The table shows some sample data for the table INSTRUCTOR.
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
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [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.
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]
(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.
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
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
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.
B
Primary key
IS
A collection of records and fields
ol
ho
Attribute
Sc
The type of data that is being stored
rt
sa
Entity
d
oo
[4]
(b) Identify three tasks that Sheila can perform using the DBMS developer interface.
M.
1 ................................................................................................................................................
s
au
2 ................................................................................................................................................
Gh
3 ................................................................................................................................................
[3]
(c) Sheila creates the database HOTEL with the following table structure:
ROOM(RoomNumber, RoomType)
(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.
RoomType ................................................,
He
................................................ (RoomNumber)
-
);
[3]
d
Complete the Data Manipulation Language (DML) statement to add the details for room
number 5 to the table ROOM.
Ma
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).
Write the correct database term in the table for each definition.
Definition Term
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
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
groups of attributes.
Ma
For a database to be in Second Normal Form (2NF), it must be in 1NF, and contain no
M.
For a database to be in Third Normal Form (3NF), it must be in 2NF, and all attributes
au
[4]
(b) The normalised relational database, SPORTS_CLUB, has the following table design.
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.
...........................................................................................................................................
Gh
..................................................................................................................................... [1]
(iii) The table shows some sample data for the table SESSION.
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]
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]
(iii) Identify one foreign key in the tables that you designed in part (a)(i).
(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
Tick (✓) one box in each row to identify whether the script is an example of a Data Definition
M.
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 1 ..............................................................................................................................
-
Description ........................................................................................................................
d
oo
...........................................................................................................................................
qs
Name 2 ..............................................................................................................................
Ma
Description ........................................................................................................................
M.
...........................................................................................................................................
[4]
s
au
Gh
CUSTOMER(CustomerID, CompanyName)
(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
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]
...........................................................................................................................................
..................................................................................................................................... [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
...........................................................................................................................................
d
...........................................................................................................................................
oo
qs
...........................................................................................................................................
Ma
..................................................................................................................................... [2]
M.
Feature 1 ...........................................................................................................................
s
au
...........................................................................................................................................
Gh
...........................................................................................................................................
...........................................................................................................................................
Feature 2 ...........................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
[4]
(iii) The DBMS provides software tools for the database developer.
Fill in the names of the missing software tools in the following statements.
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.
...........................................................................................................................................
He
...........................................................................................................................................
-
..................................................................................................................................... [2]
d
oo
...........................................................................................................................................
M.
...........................................................................................................................................
s
...........................................................................................................................................
au
..................................................................................................................................... [2]
Gh
(b) Relationships are created between tables using primary and foreign keys.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]
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]
(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
(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
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.
SCREEN(ScreenNumber, NumberSeats)
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]
(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
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.
(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
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).
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
...........................................................................................................................................
qs
Ma
...........................................................................................................................................
...........................................................................................................................................
M.
...........................................................................................................................................
s
au
...........................................................................................................................................
Gh
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[5]
(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.
(a) Draw the entity-relationship (E-R) diagram to show the relationships between the three tables.
-
d
oo
qs
Ma
M.
[2]
s
au
State what is meant by data integrity. Give an example of how the manager can ensure data
integrity in the PURPLEGAME database.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[2]
(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
...................................................................................................................................................
B
...................................................................................................................................................
IS
...................................................................................................................................................
ol
...................................................................................................................................................
ho
Sc
...................................................................................................................................................
...............................................................................................................................................[3]
rt
sa
(d) (i) The following table shows some sample data for the PLAYER table.
ad
fly918 Kylie 3
elephant11 Mehrdad 9
-
candy22 Suzi 15
d
oo
greenGrass Jason 22
qs
...........................................................................................................................................
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
(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
(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.
Description .................................................................................................................
....................................................................................................................................
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
(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]
(c) The doctors are about to set up a new clinic in the neighbouring village, SITE-B.
A new table is designed to store the ID of the doctor who is able to work at each site.
DOCTOR-AVAILABILITY(DoctorID, Site)
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.
-
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]
(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.
•
-
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
VISIT(ClientName, VisitDate)
Gh
(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]
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
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
...........................................................................................................................................
-
...........................................................................................................................................
d
oo
...........................................................................................................................................
qs
.......................................................................................................................................[2]
Ma
(c) In Area B of the hospital, there are a number of wards and a number of nurses.
M.
A nurse can be asked to work in any of the Area B wards where their specialism matches with
the ward specialism.
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
B-WARD-NURSE( ............................................................................................................ )
Complete the attributes for the third table. Underline its primary key. [2]
B
IS
B-NURSE B-WARD
ol
ho
Sc
B-WARD-NURSE
rt [2]
sa
(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.
UPDATE .............................................................................................................................
au
Gh
SET ....................................................................................................................................
WHERE ...............................................................................................................................
[3]
• a unique shop ID
• a single retail specialism (for example, food, electrical, garden).
• 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]
SHOP-SUPPLIER(ShopID, SupplierID)
Ma
The SHOP–SUPPLIER table stores the suppliers that each shop has previously used.
M.
(b) (i) Label the entities and draw the relationships to complete the revised E-R diagram.
Gh
SUPPLIER
[3]
(ii) Complete the following table to show for each database table:
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
...........................................................................................................................................
-
...........................................................................................................................................
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.
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................[3]
W 16/11/1
(a) Five descriptions and seven relational database terms are shown below.
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
Tuple
Ma
[5]
s
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
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]
(c) The CLASS table has primary key ClassID and stores the following data:
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
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.
.......................................................................................................................................[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
...........................................................................................................................................
...........................................................................................................................................
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.
CLASS(ClassID, Subject)
CLASS-GROUP(StudentID, ClassID)
B
IS
(i) Describe how this relationship is implemented.
...........................................................................................................................................
ol
ho
...........................................................................................................................................
Sc
.......................................................................................................................................[2]
(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]
S 16/13/5(a)
(a) A Database Management System (DBMS) provides the following features.
Feature Description
B
IS
ol
Data design features to ensure the validity
of data in the database
ho
Sc
Data security
[3]
qs
Ma
M.
s
au
Gh
S 15/11/9
A database has been designed to store data about salespersons and the products they have sold.
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
toaster 3 GK
-
(a) State why the table is not in First Normal Form (1NF).
d
oo
...................................................................................................................................................
qs
...............................................................................................................................................[1]
Ma
M.
s
au
Gh
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
[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.
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
B
IS
.......................................................................................................................................[2]
(ii) Explain why the SalesProducts table is not in Third Normal Form (3NF).
ol
ho
...........................................................................................................................................
Sc
...........................................................................................................................................
rt
...........................................................................................................................................
sa
.......................................................................................................................................[2]
ad
...........................................................................................................................................
-
...........................................................................................................................................
d
oo
...........................................................................................................................................
qs
.......................................................................................................................................[2]
Ma
M.
s
au
Gh