Databases and SQL – A Level Computer Science (old syllabus, to 2021) (9608)

25 questions · page 1 of 2 · Clear filters

0 / 0Answer a question to start your score.
Quick quiz (10)Saved 0
Advertisement
1
9608/11/O/N/21 · Question 9Oct/Nov 2021Paper 117 marks
Loading question…
Question text

9
An airline company uses a relational database to store data about passengers and flights.
Part of the database is shown.
PASSENGER(PassengerID, FirstName, LastName)
FLIGHT(FlightID, FlightDate, FlightTime)
PASSENGER_LIST(FlightID, PassengerID, SeatNo)
(a) Complete the entity-relationship (E-R) diagram to show the relationships between the given
tables.
PASSENGER
FLIGHT
PASSENGER_LIST
[2]
(b) The following is example data for the table FLIGHT:
FlightID
FlightDate
FlightTime
MO126
05/05/21
09:00
GK6708
06/09/21
00:30
BA0897
08/12/21
15:30
Write Data Definition Language (DDL) statements to define the table FLIGHT.
…
…
…
…
…
…
… [5]

2
9608/12/O/N/21 · Question 8Oct/Nov 2021Paper 1219 marks
Loading question…
Question text

8
An employment agency keeps records of its contracts with employers and workers in a relational
database.
These are some of the tables in the database:
EMPLOYER(EmpId, EmpName, EmpAddress, EmpPhoneNumber)
WORKER(WkId, WkFirstName, WkLastName, WkAddress, WkPhoneNumber)
CONTRACT_TYPE(ConTypeId, ConName)
CONTRACT(ConId, ConTypeId, EmpId, WkId, RefConNumber)
(a) Complete the entity-relationship (E-R) diagram for this part of the database.
EMPLOYER
WORKER
CONTRACT
CONTRACT_TYPE
[3]
(b) Write a Data Definition Language (DDL) statement to change the CONTRACT table to remove
the attribute RefConNumber.
…
…
…
… [2]
(c) The following table has examples of DDL and Data Manipulation Language (DML) statements.
Tick (✓) one box in each row to identify whether each statement is an example of DML or
DDL.
Statement
DML
DDL
ADD PRIMARY KEY
ALTER TABLE
SELECT FROM
INNER JOIN
CREATE DATABASE
[2]
(d) The field WkPhoneNumber cannot be empty and must have a maximum of 14 characters.
Describe two ways the field WkPhoneNumber can be validated.
1 …
…
…
…
2 …
…
…
…
[4]
(e) State what is meant by a candidate key.
…
… [1]
(f)
Describe what is meant by a secondary key.
…
…
…
… [2]
(g) The database is stored on a magnetic hard disk.
Describe the basic internal layout and operation of a magnetic hard disk drive.
…

3
9608/13/O/N/21 · Question 9Oct/Nov 2021Paper 1319 marks
Loading question…
Question text

9
A company uses a relational database.
(a) The company stores data about its customers and their bank details.
Explain the ways in which the database can be set up to only allow certain people to see the
bank details.
…
…
…
… [2]
(b) The database contains the following tables that store data about suppliers and stock.
SUPPLIER(SupId, SupName, SupAddress, SupPhone, SupContactName)
STOCK(StockId, SupId, StockName, StockImage, NumberInStock)
(i)
Write Data Manipulation Language (DML) statements to return the supplier name, phone
number and contact name, and the number of items in stock for the item with the stock
ID of D930.
…
…
…
…
…
… [4]
(ii)
The stock price needs to be included in the stock table.
$10.55 and $299.99 are two examples of stock prices.
Write Data Definition Language (DDL) statements to insert the attribute StockPrice
into the table STOCK.
…
…
…
… [2]
(c) Three examples of items stored in the data dictionary of a relational database are:
Item
Purpose
Field name
to store the names of fields so they cannot be repeated in a table
Primary key
to uniquely identify each record in a table
Validation rule
to ensure that data entered is sensible
Identify three other examples of items stored in a data dictionary and give the purpose of
each.
Item 1 …
Purpose …
…
…
Item 2 …
Purpose …

Advertisement
4
9608/11/O/N/20 · Question 2Oct/Nov 2020Paper 1127 marks
Loading question…
Question text

2
A veterinary surgery cares for sick animals. The surgery has a file-based database that stores
data about the pets, their owners, and appointments made with the surgery.
The surgery wants to upgrade to a relational database.
(a) Explain the reasons why the surgery should upgrade their database.
…
…
…
…
…
…
…
… [4]
(b) The design for the surgery database, SURGERY, is:
PET(PetID, OwnerFirstName, OwnerLastName, PetName, PetBreed,
PetDateOfBirth, TelephoneNumber)
APPOINTMENT(AppointmentID, Date, Time, StaffID, PetID)
(i)
Give one reason why the database design for SURGERY is not in Third Normal Form
(3NF).
…
… [1]
(ii)
The database needs to be normalised to 3NF. A pet may have more than one owner and
an owner may have more than one pet.
The appointment table does not need to change and has been repeated below.
Give the name and attributes of three additional tables in 3NF. Identify the primary
key(s) in each table.
APPOINTMENT(AppointmentID, Date, Time, StaffID, PetID)
Table 1 …
…
…
Table 2 …
…
…
Table 3 …
…
…
[4]
(c) Part of the table APPOINTMENT is shown. The veterinary surgery uses Data Manipulation
Language (DML) statements to search for appointments.
AppointmentID
Date
Time
StaffID
PetID
222010
02/02/2021
12:40
JK1
20CF
222011
02/02/2021
12:40
PP2
10DT
222012
02/02/2021
12:50
JK1
9RR
222013
02/02/2021
13:00
JK1

5
9608/12/O/N/20 · Question 5Oct/Nov 2020Paper 1232 marks
Loading question…
Question text

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.
…
…
…
…
…
…
…
… [4]
(b) The teacher sets up the RESULTS database using a Database Management System (DBMS).
(i)
Explain the ways in which the developer interface of a DBMS will help the teacher set up
the database.
…
…
…
… [2]
(ii)
The DBMS creates a data dictionary for the RESULTS database.
Identify three items that will be included in the data dictionary.
1 …
2 …
3 …
[3]
(c) The RESULTS database has the following structure:
STUDENT(StudentID, FirstName, LastName, Class, TargetGrade)
TEST(TestID, Topic, MaxMarks)
STUDENT_TEST(StudentID, TestID, Mark)
(i)
Complete the following table by giving one example of each database term from the
database RESULTS. Give both the field name and the corresponding table name.
Database term
Field name
Table name
Primary key
Foreign key
Attribute
[3]
(ii)
Tick (✓) one box to identify whether the database RESULTS is in 1NF, 2NF or 3NF.
Justify your choice.
1NF
2NF
3NF
Justification: …
…
…
… [3]
(iii)
Complete the Data Manipulation Language (DML) script to display the Student ID, mark
and maximum marks for all tests with the topic of ‘Programming’.
SELECT StudentID, Mark, ...

6
9608/11/M/J/20 · Question 7May/June 2020Paper 1115 marks
Loading question…
Question text

7
A driving school teaches people how to drive cars. The school has a relational database,
DRIVING_SCHOOL, to store information about instructors, students, lessons and the cars used by
instructors.
INSTRUCTOR(InstructorID, FirstName, LastName, DateOfBirth, Level)
CAR(Registration, Make, Model, EngineSize)
INSTRUCTOR_CAR(InstructorID, Registration)
STUDENT(StudentID, FirstName, LastName, DateOfBirth, Address1)
LESSON(LessonID, StudentID, InstructorID, LessonDate, LessonTime)
(a) Give two benefits to the driving school of using a relational database instead of a flat file.
1 …
…
2 …
…
[2]
(b) Complete the entity-relationship diagram for the database DRIVING_SCHOOL.
INSTRUCTOR
INSTRUCTOR_CAR
CAR
LESSON
STUDENT
[4]
(c) The table shows some sample data for the table INSTRUCTOR.
InstructorID
FirstName
LastName
DateOfBirth
Level
Ins01
Jayden
Han
05/06/1974
1
Ins02
Freda
Choi
06/02/1978
2
Ins03
Kelly
Kim
01/12/1966
1
Ins04
Santana
Thompson
09/09/1985
3
Complete the Data Definition Language (DDL) statement to create the table INSTRUCTOR.
… TABLE INSTRUCTOR(
InstructorID VARCHAR(5),
FirstName VARCHAR(15),
LastName VARCHAR(15),
DateOfBirth DATE,
Level … ,
… (InstructorID)
);
[3]
(d) The table STUDENT needs an additional field to store the student’s telephone number, for
example 012-3456.
Write a Data Definition Language (DDL) statement to add the new field to the table STUDENT.
…
…
…
… [2]
(e) Write a Data Manipulation Language (DML) statement to return the date and time of all future
lessons booked with the instructor whose InstructorID is Ins01.
…
…
…
…
…
…
… [4]

7
9608/12/M/J/20 · Question 6May/June 2020Paper 1213 marks
Loading question…
Question text

6
A software development company has a relational database, SOFTWARE_MANAGEMENT. The
database stores details of the customers who have purchased software, as well as the software
and licences that customers have purchased.
The SOFTWARE_MANAGEMENT database has the following tables:
CUSTOMER_DETAILS(CustomerID, CompanyName, Address1, Address2, City)
SOFTWARE_PURCHASED( SoftwareName, SoftwareDescription, CustomerID,
LicenceType, LicenceCost, RenewalDate)
(a) Explain why this database is not in Third Normal Form (3NF). Refer to the tables in your
answer.
Do not attempt to normalise the tables.
…
…
…
…
…
… [2]
(b) Give an example from the database SOFTWARE_MANAGEMENT for each of the following
database terms.
Term
Example
Entity
Foreign key
Attribute
[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.
The table shows example data in GAME_DEVELOPMENT.
GameName
Genre
TeamNumber
DevelopmentStage
ManagerID
Bunny Hop
Platform
4
Analysis
23KP
Fried Eggs
Retro
2
Programming stage 1
9RTU
Create‑a‑game
Action
1
Acceptance testing
11TF
(i)
Complete the Data Definition Language (DDL) statement to create the table
GAME_DEVELOPMENT.
CREATE …
… (
GameName VarChar,
Genre VarChar,
…
… ,
DevelopmentStage VarChar,
ManagerID VarChar,
… (GameName)
);
[5]
(ii)
Another table, PRODUCT_MANAGER, is created.
PRODUCT_MANAGER(ManagerID, FirstName, LastName)
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
name ‘James’ and the last name ‘Fitz’.
… GameName, Genre, TeamNumber
FROM GAME_DEVELOPMENT, PRODUCT_MANAGER
WHERE PRODUCT_MANAGER.FirstName = "James"
AND PRODUCT_MANAGER.LastName = "Fitz"
AND …
= … ;
[3]

8
9608/13/M/J/20 · Question 6May/June 2020Paper 1314 marks
Loading question…
Question text

6
Sheila creates a relational database for her hotel using a Database Management System (DBMS).
(a) Draw one line from each database term to its most appropriate description.
Database Term
Description
A field in one table that links to a primary key in another table
Primary key
A collection of records and fields
Attribute
The type of data that is being stored
A unique identifier for each tuple
Foreign key
A data item, represented as a field within a table
Entity
The concept or object in the system that we want to model
and store information about
[4]
(b) Identify three tasks that Sheila can perform using the DBMS developer interface.
1 …
2 …
3 …
[3]
(c) Sheila creates the database HOTEL with the following table structure:
ROOM(RoomNumber, RoomType)
BOOKING(BookingID, RoomNumber, CustomerID, StartDate)
CUSTOMER(CustomerID, FirstName, LastName, Address, Tel_Num)
(i)
The following table shows some sample data for the table ROOM.
RoomNumber
RoomType
1
Standard
2
Double
3
Executive
4
Standard
Complete the Data Definition Language (DDL) statement to create the table ROOM.
… TABLE ROOM(
RoomNumber Integer,
RoomType … ,
… (RoomNumber)
);
[3]
(ii)
Room number 5 is a Double room.
Complete the Data Manipulation Language (DML) statement to add the details for room
number 5 to the table ROOM.
INSERT … ROOM
VALUES( … );
[2]
(iii)
The table BOOKING needs an additional field to store the number of nights (for example,
3) a customer is staying.
Write a Data Definition Language (DDL) statement to add the new field to the table
BOOKING.
…
…
…
…
… [2]

Advertisement
9
9608/13/O/N/19 · Question 3Oct/Nov 2019Paper 1313 marks
Loading question…
Question text

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.
The hotel creates a normalised, relational database to store the required information. There
are three tables:
•
CUSTOMER
•
ROOM
•
BOOKING
(i)
Complete the database design for the hotel by writing the attributes for each table.
CUSTOMER( …
…
… )
ROOM( …
…
… )
BOOKING( …
…
… )
[3]
(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).
Table name …
Foreign key …
[1]
(b) The hotel wants to use a Database Management System (DBMS) to set up and manage the
database.
Describe, using examples, how the hotel can use the following DBMS tools:
Developer interface …
…
…
…
…
Query processor …
…
…

10
9608/11/M/J/19 · Question 2May/June 2019Paper 1119 marks
Loading question…
Question text

2
A software company produces software and distributes it under different software licences.
(a) Four descriptions of software licences are given.
Write the type of software licence that best fits each description. Use a different type of licence
for each description.
1. The software can be legally used, only after a fee has been paid.
Licence type …
2. The source code comes with the software. If the software is modified, the edited source
code must be released under the same conditions as the original software.
Licence type …
3. The software is free for a trial period and then a fee is requested, or expected, if the user
wants to continue to use the software.
Licence type …
4. The source code comes with the software. The software is free to be downloaded, edited,
and distributed, possibly without restriction.
Licence type …
[4]
(b) The software company stores information about customers and the software licences they
have purchased. The company considers a file-based approach for the storage and retrieval
of data.
(i)
Give three limitations of a file-based approach to store the data.
1 …
…
2 …
…
3 …
…
[3]
(ii)
The software company decides to use a database to overcome the limitations of a
file-based system. Some of these limitations are addressed through the logical schema.
Name and describe two levels of the schema of a database.
Name 1 …
Description …
…
Name 2 …
Description …
…
[4]
(c) The database has the following tables:
CUSTOMER(CustomerID, CompanyName)
SOFTWARE(SoftwareID, SoftwareName, OperatingSystem, Description)
LICENCE( LicenceID, CustomerID, SoftwareID, DateOfPurchase,
LicenceType, Cost, ExpiryDate)
(i)
Identify the type of relationship that exists between the tables CUSTOMER and LICENCE.
…
…

11
9608/12/M/J/19 · Question 5May/June 2019Paper 1212 marks
Loading question…
Question text

5
Moheem is creating a relational database to store data about his customers.
(a) Moheem has been told a relational database addresses some of the limitations of a file-based
approach by reducing data redundancy.
(i)
State what is meant by the term data redundancy.
…
… [1]
(ii)
Explain how a relational database can help to reduce data redundancy.
…
…
…
…
…
… [3]
(b) Moheem uses a Database Management System (DBMS) to ensure the security and integrity
of the data.
(i)
Explain the difference between security and integrity.
…
…
…
… [2]
(ii)
Name and describe two security features provided by a DBMS.
Feature 1 …
…
…
…
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.
A … allows a developer to extract data from a
database.
A … enables a developer to create user-friendly
forms and reports.
[2]

12
9608/13/M/J/19 · Question 3May/June 2019Paper 1323 marks
Loading question…
Question text

3
A company uses a relational database, EMPLOYEES, to store data about its employees and
departments.
(a) The company uses a Database Management System (DBMS).
(i)
The DBMS has a data dictionary.
Describe what the data dictionary stores.
…
…
…
… [2]
(ii)
The DBMS has a query processor.
Describe the purpose of a query processor.
…
…
…
… [2]
(b) Relationships are created between tables using primary and foreign keys.
Describe the role of a primary and a foreign key in database relationships.
…
…
…
… [2]
(c) In the company:
•
An employee can be a manager.
•
A department can have several managers and several employees.
•
An employee can only belong to one department.
The EMPLOYEES database has three tables:
EMPLOYEE_DATA( EmployeeID, FirstName, LastName, DateOfBirth, Gender,
DepartmentNumber)
DEPARTMENT(DepartmentNumber, DepartmentName)
DEPARTMENT_MANAGER(DepartmentNumber, EmployeeID, role)
Complete the entity-relationship (E-R) diagram for the EMPLOYEES database.
EMPLOYEE_DATA
DEPARTMENT_MANAGER
DEPARTMENT
[3]
(d) Give three reasons why the EMPLOYEES database is fully normalised.
1 …
…
2 …
…
3 …
…
[3]
(e) Part of the EMPLOYEE_DATA table is shown.
EmployeeID
FirstName
LastName
DateOfBirth
Gender
DepartmentNumber
156FJEK
Harvey
Kim
12/05/1984
Male
S1
558RRKL
Catriona
Moore
03/03/1978
Female
F2
388LMDV
Oscar
Ciao
01/01/1987
Male
F2
(i)
Write a Data Definition Language (DDL) statement to create the EMPLOYE

13
9608/11/O/N/18 · Question 7Oct/Nov 2018Paper 1112 marks
Loading question…
Question text

7
A movie theatre has a relational database that stores the movie schedule, and information about
the movies. The theatre has several screens that play movies at the same time.
The database has three tables to store information about the movies, the screens and the movie
schedule.
MOVIE(MovieID, Title, Length, Rating)
SCREEN(ScreenNumber, NumberSeats)
MOVIESCHEDULE(ScheduleID, MovieID, ScreenNumber, Time)
(a) Complete the entity-relationship (E-R) diagram to show the relationships between these
tables.
MOVIE
SCREEN
MOVIESCHEDULE
[2]
(b) Explain how primary and foreign keys are used to link the tables in the movie theatre
database.
…
…
…
…
…
…
… [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.
…
…
…
…
… [2]
(d) Write an SQL script to display the title and rating of all movies scheduled to play on screen
number 3.
…
…
…
…
…
…
…
…
…

Advertisement
14
9608/12/M/J/18 · Question 7May/June 2018Paper 1217 marks
Loading question…
Question text

7
A social media website has a relational database, WEBDATA, that stores the site’s information.
The database has three tables to store users’ details, and details of the images and text that they
post.
USER(UserName, FirstName, SecondName, DateOfBirth)
PHOTO(PhotoID, UserName, Comment, UploadDate)
TEXTPOST(PostID, UserName, DateOfPost, TheText)
(a) (i)
Explain how the relationship between the tables USER and PHOTO has been implemented.
…
…
…
… [2]
(ii)
Draw the entity-relationship (E-R) diagram to show the relationships between the three
tables.
[2]
(b) A database administrator decides to enforce referential integrity.
Use an example from the database WEBDATA to explain what is meant by referential
integrity.
…
…
…
…
…
… [3]
(c) The database has been normalised to Third Normal Form (3NF).
Define the three stages of database normalisation.
1NF …
…
2NF …
…
3NF …
…
[3]
(d) The following shows sample data from the USER table.
UserName
FirstName
SecondName
DateOfBirth
gem123
John
Smith
01/01/1995
purpleSky
Muhammed
Ali
23/02/1956
OpenWindow
Sunny
Amir
03/03/1997
bluebird127
Raziya
Bello
04/03/1982
(i)
Write an SQL script to create the USER table.
…
…
…
…

15
9608/13/M/J/18 · Question 2May/June 2018Paper 1314 marks
Loading question…
Question text

2
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.
The database has three tables to store player’s details, dates when they have logged into the app
and in-app purchase details.
LOGIN(LoginID, PlayerID, Date)
PURCHASE(PurchaseID, PlayerID, PurchaseDate, Cost)
PLAYER(PlayerID, PlayerName, SkillLevel)
(a) Draw the entity-relationship (E-R) diagram to show the relationships between the three tables.
[2]
(b) The database manager is concerned about data integrity.
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
Justify your choice.
…
…
…
…
…
… [3]
(d) (i)
The following table shows some sample data for the PLAYER table.
PlayerID
PlayerName
SkillLevel
fly918
Kylie
3
elephant11
Mehrdad
9
candy22
Suzi
15
greenGrass
Jason
22
Write an SQL script to create the PLAYER table.
…
…
…
…
…
…
…
…
…
…

Advertisement