Design (SQA National 5 Computing Science): Exam Questions

Exam code: X816 75

1 hour16 questions
1
1 mark

A data dictionary includes entity names and attribute names.

State one other item of information that would be included in a data dictionary.

2a
4 marks

A primary school is organising a range of 30 activities for its 550 pupils for the last day of term. The organiser wishes to create and use a database.

The following are essential.

Each pupil selects one activity. They must return a form which contains their name, class and emergency contact details.

The organiser provides class teachers with a list of pupils’ names and chosen activities.

Each activity has a leader and a unique activity name. Activity prices range from £2 to £30. The organiser provides a list for each activity leader, showing each pupil’s name, class and emergency contact details.

The organiser records which pupils have returned a form so that they can search for pupils who have not signed up to an activity.

Complete the entity-relationship diagram on the opposite page for the database by:

  • naming the entities

  • drawing any missing attributes from either entity

  • drawing the relationship between the entities

  • naming the relationship between the entities.

Diagram with two central boxes. Left box is linked to: pupilID, name, formReturned, activityName*, emergencyContact, class. Right box links to activityName.
2b
1 mark

Identify the attribute that would be stored as a Boolean field when the database is implemented.

2c
3 marks

When the database is implemented validation is added to several fields. (i)

(i)The primary school has 14 different class names. For example P1A, P4B, P6/7A.

Describe how validation of this field could be implemented when the database tables are created.

[2]

(ii) State one field where range validation would be appropriate.

[1]

3
4 marks

A car retailer has four showrooms.

A relational database is used to store details of the four showrooms and the cars they have for sale.

Showroom

showroomID

city

manager

Gla1

Glasgow

Ray Rain

Gla2

Glasgow

Kate Jones

Abd

Aberdeen

Sue Gearan

Dun

Dundee

Sadiq Yavuz

Car

carID

make

model

colour

seats

salePrice

showroomID

1

McLaren

F1

blue

3

900000

Dun

2

Jaguar

XKR

silver

2

70000

Gla1

3

SMART

Sports

green

3

22300

Abd

4

Nissan

GT-R

red

4

80000

Dun

5

Alfa Romeo

Giulia

green

2

50000

Dun

6

Audi

TT Coupe

white

4

12050

Gla2

7

Mazda

MX-5

black

2

21987

Abd

8

Jaguar

F-Type

red

2

105200

Dun

9

SMART

Sports

yellow

3

17000

Gla1

Design a query that would output the model, number of seats and the showroom manager for all the Jaguar cars located in Glasgow.

Field(s)

Table(s)

Search criteria

4a
2 marks

A restaurant stores employee details in a database. Each employee is trained as either a chef, a server, a manager or a cleaner. Sample data from the database is shown below.

Employee

empID

empName

jobTitle

startDate

fullTime

contactNum

117254

Alex Roberts

Manager

21/10/24

07701675815

259631

Rayyan Patel

Chef

05/09/23

07778589526

300193

Charlie King

Server

10/03/25

07789900991

220205

Sam Scott

Cleaner

13/02/25

07811606115

576482

Drew Moore

Cleaner

30/12/24

07705900169

365482

Carter Price

Server

23/01/25

07716168759

419372

Rowan Kelly

Chef

07/07/24

07700148652

895714

Jun Baek

Server

30/04/25

07812612568

681354

Nikan Khan

Manager

06/08/23

07780254369

Complete the missing attribute and attribute type in the table below.

Attribute

Attribute type

contactNum

Boolean

4b
1 mark

Errors are made when data is entered for new employees.

State one attribute where restricted choice validation could be used to reduce errors.

5a
3 marks

A band booking company has a range of bands that can be booked for various events. It wants a database to store information on bands and their bookings.

A band can play more than one event. An event can only have one band.

When a band is being booked for an event the form below is completed.

Form for booking a band. Fields for event name, date, venue, and email. Band dropdown shows "Ross Wonder" details: rock genre, £1500, 2 members.

When the band has been booked, the following e-mail is sent to the organiser.

Congratulations.

You are all booked. You have been given the exclusive event ID 1318.

Ross Wonder is looking forward to playing at your event.

Complete the entity relationship diagram by:

  • identifying the key attributes

  • drawing the relationship between the entities

  • naming the relationship.

Diagram showing two entities: Band and Event. Band includes bandName, cost, numMembers, genre, bandRef. Event includes bandRef, eventName, venue, date, eventID, bookingEmail.
5b
1 mark

Customers’ personal details have been stolen.

State one requirement of the UK General Data Protection Regulation (GDPR) that the company should have implemented to prevent this from happening.

6
5 marks

Caledonian Wheels organises a motorsport racing championship. A database is used to store data on racing teams and their individual drivers. The data stored in the database is shown below.

Team

teamID

teamName

titlesWon

location

RR32

Rapid Racers

7

Italy

SS21

Swift Streaks

3

United Kingdom

TT16

Turbo Titans

2

Germany

VR12

Velocity Vipers

4

Italy

ER54

Elite Racers

1

United Kingdom

PV81

Prime Speed

5

Spain

Driver

driverNum

forename

surname

wins

points

teamID

1

Shannon

Kelly

5

125

ER54

3

Ezri

Wuzik

2

50

PV81

4

Jackie

Price

2

50

RR32

11

Kai

West

4

100

SS21

14

Charlie

Wilkinson

1

25

TT16

18

Moss

Gray

0

0

VR12

22

Kris

Hunt

1

25

SS21

31

Meenal

Ibrahim

3

75

VR12

55

Ollie

Graham

6

150

TT16

63

Gerry

Fox

0

0

PV81

77

Jackie

West

1

25

ER54

81

Akari

Ogawa

0

0

RR32

Caledonian Wheels want to share details about all the UK based drivers who have had a successful year so far.

(i) Design a query to search the database for a driver’s full name, driver number and team name who have won more than three races and drive for a United Kingdom based team.

[4]

Field(s)

Table(s)

Search Criteria

(ii)Describe how the SQL statement could be tested when the query is created.

[1]

7
1 mark

Riley wants to add a new contact on their mobile phone.

Smartphone screen showing a new contact form with fields for name and photo, and an arrow pointing to the 'Add' icon beside a phone number entry.

State the attribute type that would be used to store the data identified by the arrow above.

8
1 mark

Nathan cancels his ClipClop social media account.

Describe one implication for ClipClop under UK General Data Protection Regulation.

9
5 marks

The Games Lab is a video game testing company that programmers can send games to for testing. Each game is allocated to a tester who works on several different games. Testers are based in three offices — Scotland, France and Australia — and only accept games rated 12A, 15 and 18.

(i) Use the information provided to complete the entity‑relationship diagram below by:

  • identifying any additional key attributes

  • drawing any missing attributes

  • drawing the relationship between entities

  • naming the relationship between the entities.

[4]

Entity-relationship diagram showing Game and Tester entities. Game includes gameID, gameName, rating, testerID, programmer, multiplatform. Tester has testerID, name, contactNo.

(ii) State the validation to be applied to the Rating attribute.

[1]

10a
1 mark

A database stores data on a local netball league. The Club table stores data of the clubs that play in the league. The Player table stores data on each player.

Sample data from each table is shown below.

Club

clubID

clubName

trainingVenue

contactNo

division

A2706

Joint Forces

Glasgow

01415829631

3

B1803

Shooting Stars

Renfrewshire

01245668123

2

E0408

Team Titans

Glasgow

01415571239

1

P2507

Hot Shots

Lanarkshire

01245789456

1

H0311

Throwing Tigers

Glasgow

01418529637

2

Player

playerID

name

email

age

position

clubID

358

Meenal

[email protected] (opens in a new tab)

21

Goal keeper

E0408

562

Jacob

[email protected] (opens in a new tab)

25

Goal shooter

A2706

981

Tara

[email protected] (opens in a new tab)

24

Centre

P2507

742

Ibrahim

[email protected] (opens in a new tab)

36

Wing defence

E0408

801

Devin

[email protected] (opens in a new tab)

30

Goal shooter

B1803

129

Amber

[email protected] (opens in a new tab)

21

Wing attack

A2706

232

Xander

[email protected] (opens in a new tab)

38

Goal defence

E0408

475

Harris

[email protected] (opens in a new tab)

36

Goal attack

E0408

603

Zohra

[email protected] (opens in a new tab)

32

Centre

B1803

Explain the purpose of the foreign key clubID in the Player table.

10b
4 marks

Design a query that could be used to create a list of names and the division for Goal keepers that are over 30 years old.

Field(s)

Table(s)

Search Criteria

11a
1 mark

A database table stores data about balloon orders.

Order

orderID

type

personalise

price

colour

collection

NS254

Number

No

5.29

Silver

11/09/2023

SM892

Star

Yes

3.99

Red

25/08/2023

CM762

Circle

Yes

2.99

Red

25/08/2023

CM766

Circle

Yes

4.99

Blue

05/06/2023

NG982

No1 Friend

No

3.49

Gold

01/08/2023

NB118

No1 Teacher

No

3.49

Blue

20/06/2023

Balloons are available in a limited number of colours.

State the type of validation that should be implemented to achieve this.

11b
2 marks

State the attribute type required for the following attributes.

Attribute

Attribute type

personalise

collection

12
4 marks

A window cleaning company wishes to create a database to store information about staff and the houses they clean. The company provides examples of information they would like to include.

Two notepads list house and staff details: house ID, customer name, address, direct debit, windows, cost; staff ID, name, phone, hours per week.

Each staff member is allocated a number of houses to clean. They clean the windows of the same houses each month.

Use the information provided to complete the entity relationship diagram below by:

  • adding the missing key attribute

  • drawing the relationship between the entities

  • naming the relationship between the entities.

Entity-relationship diagram showing two entities: House with attributes like address, houseID; and Staff with attributes like staffID, contactTel.
13
4 marks

Bright Stars organise and run classes for children. Classes are organised into blocks, each running for 8 weeks.

The table Class stores data about the classes available.

The table Booking stores data about the children and their parents/guardians.

Sample data from each table is shown below.

Class

classID

leaderName

day

time

location

sessionBlock

classAge

S1-141

Suzanne

Mon

10:45

Grange

Summer

1-2 Years

S2-228

Claire

Tue

11:50

Lothianburn

Autumn

3-4 Years

S2-871

Jo

Mon

13:00

Gorebridge

Spring

3-4 Years

B1-121

David

Thur

15:30

Biggar

Winter

Babies

S1-333

Alexander

Wed

13:00

Coldingham

Summer

1-2 Years

S2-519

Claire

Fri

10:45

Lothianburn

Autumn

3-4 Years

B3-435

Jose

Wed

09:30

Gorebridge

Spring

Babies

Booking

bookingID

parentName

email

childName

childDOB

paid

classID

EF220731

Esme Faulds

[email protected] (opens in a new tab)

Quinn

25/09/2022

No

S1-333

TR238270

Tim Roberts

[email protected] (opens in a new tab)

Lucas

05/02/2023

Yes

B1-121

ZA200836

Zoe Archer

[email protected] (opens in a new tab)

Blake

11/01/2020

Yes

S2-288

FY229853

Fen Yang

[email protected] (opens in a new tab)

Freya

06/06/2022

No

S1-333

Spring classes for babies are ending soon. An email needs to be sent to all parents to offer them a place in the Summer classes.

Design a query that could be used to generate a list of names and email addresses of parents with a child who attends a Spring class for babies.

Field(s)

Table(s)

Search Criteria

14
1 mark

Every book that is published is given a unique reference as shown below.

978-1-471-83603-9

State the data type that would be used to store this reference in a database

15a
1 mark

Aabish is writing a book about the history of computer animation studios and the characters created by each studio.

As part of her research she makes notes about the studios and characters.

Four overlapping index cards with handwritten details about animation studios and characters, highlighting UK, Japan, and "Animal" style.

She decides to store this information in a relational database using two entities called character and studio.

Complete the diagram below to show the relationship between the character entity and the studio entity

Two rectangular boxes, each with text inside; the left box reads "character" and the right box reads "studio", both centred on a plain background.
15b
10 marks

Aabish populates the database with several studios and hundreds of characters. Sample data from each table is shown below.

Studio

studioID

studioName

dateFormed

location

staff

LUX01

Luxar

23/09/1985

Japan

452

DES01

Desney

10/01/2001

UK

298

DES02

Desney

29/10/1992

Japan

1053

Character

charID

name

createdBy

year

appearances

style

studioID

1

Fred

F. Smith

1994

23

Person

DES01

2

Daisy Donkey

G.R. Bryant

2003

342

Animal

DES02

3

Toaster

K. Kali

2018  6

Object

DES02

4

Fred

Z. Wayne

1994

76

Alien

LUX01

Design a query that could be used to create a list of character names and styles created by ‘K. Bell’ at the Japanese branch of Goban studios.

[5]

Field(s)

Table(s)

Search criteria

(ii) Aabish uses the database to identify the characters with the least number of appearances from all studios.

name

style

appearances

Triple Tiger

Animal

3

Toaster

Object

6

Davio

Animal

12

Fred

Person

23

Arthur

Alien

24

Biggles

Object

39

Aabish wants to produce similar output for only the Desney studio characters.

Complete the SQL statement below that would produce this output.

SELECT...................................................................................................

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

WHERE ...................................................................................................

ORDER BY................................................................................................

[5]

16a
3 marks

A property renovation company requires a relational database to store information about the tasks to be carried out on each room of a house.

The functional requirements for the database are identified:

  • Store details of each room in the house.

  • Store details of each task.

  • Output a list of tasks carried out by one of the following trades people: electrician, builder, plasterer, decorator, carpenter, plumber.

  • Output a list of tasks completed for a single room.

(i) Complete the entity relationship diagram below by identifying key attributes.

[2]

Diagram showing a relationship between "Room" and "Task." Room attributes include name, width, length, height, floor. Task attributes include description, dateStarted, hoursTaken, completed, tradesPerson, taskID, cost (£).

(ii) Use the functional requirements above to identify the attribute in the ‘Task’ entity that would be implemented using restricted choice validation.

[1]

16b
1 mark

Explain why the General Data Protection Regulations do not apply to the information that will be stored in this database.