Font size
WorksheetsN5CS: Database Design
Total questions: 100
Worksheet time: 51mins
Which is a type of simple database consisting of a single table?
Hierarchical database
Flat-file database
Cloud database
NoSQL database
What type of relationship cardinality between entities do you need to be able to use for N5 Computing Science?
One-to-one
Many-to-many
One-to-many
Many-to-one
What database design elements should you be able to create and describe for N5 Computing Science?
Process flow diagrams using three entities
Entity-relationship diagrams using two entities
UML diagrams using four entities
Gantt charts using five entities
For N5 Computing science you should be able to design, create, and explain a query making use of which elements?
Tables, fields, search criteria, and sort order
Macros, modules, forms, and reports
Classes, objects, functions, and variables
Spreadsheets, cells, formulas, and charts
What type of database model is used in National 5 Computing Science?
Hierarchical database model
Network database model
Relational database model
Object-oriented database model
What is a flat-file database particularly useful for?
Storing data about a single entity
Storing data about multiple entities
Storing data with a single attribute
Storing data with a single record
Which of the following is NOT one of the three main elements of a relational database mentioned in the text?
Entities
Attributes
Relationships
Indexes
In a flat-file database, what is used to represent a record?
A field
A column
A row
A table
What is used to represent a field in a flat-file database?
A record
A column
A row
A table
What is meant by an entity in the context of databases?
A collection of attributes
A naming convention
A person, object or thing that we want to store information about
A type of database system
What is an entity set?
A database system
A single entity
A collection of entities
A naming convention for entities
Which of the following is NOT an example of a suitable attribute for a student entity?
First name
Date of birth
Color of eyes
Postcode
What naming convention is normally used for attribute and entity names?
Uppercase letters with spaces (FIRST NAME)
Lowercase letters with no spaces or punctuation (firstname)
CamelCase notation (firstName)
Randomly mixed case with special characters (fIrSt*NaMe)
What would be the correct name for a Customer ID attribute in a database?
CustomerID
customerid
customerID
CustomerId
Which of these attributes would most likely be associated with a 'car' entity?
breed
buildheight
numberofseats
visibledistance
What is the correct name for a 'Date of Birth' attribute following the naming convention?
DateOfBirth
dateofbirth
dateOfBirth
Dateofbirth
Which of these attributes would most likely be associated with a 'horse' entity?
enginecapacity
gallopspeed
location
tailength
Which of these attributes would most likely be associated with a 'lighthouse' entity?
steeringtype
make
visibledistance
numberofseats
Why is it useful to hold data in two entities rather than having it all in one?
To avoid any repetition or duplication of data
To make the data more complex
To reduce the amount of data stored
To avoid creating any relationships between data
What attribute is shared between the hairdresser entity and the client entity to establish a relationship?
salon
contactnumber
hairdresserid
clientlastname
Why are table names usually titled as singular (e.g., client) rather than plural (e.g., clients)?
Beacuse it reflects that the table is a collection of single instances of entities
Because it reflects the number of entities stored in the database
Because singular titles are shorter than plural titles
Because it is a requirement of the database software
How many clients does the hairdresser with the firstname "Sharon" have according to the table?
1
2
3
4
Which salon does the hairdresser with the hairdresserid "2210" work at?
West Style
On The Corner
Cuts & Co
Not listed
What is the correct phone number for the client with clientid "10290"?
0141 496 0536
07700 900556
07700 900569
0151 496 0838
Which hairdresser has the lastname "Christie"?
Huda
Sharon
Phillip
Michael
What cardinality of relationship exists between the hairdresser and the client according to the example provided?
Many-to-many relationship
One-to-one relationship
One-to-many relationship
Many-to-one relationship
How many clients does Phillip have based on the example given?
2
3
4
5
According to the doctors and patients example, how many registered patients does Dr. James Brown have?
1
2
3
4
Is it possible for a client to have more than one hairdresser according to the one-to-many relationship described?
Yes, clients can have multiple hairdressers.
No, each client can have just one hairdresser.
Yes, but only if the hairdressers work at the same salon.
No, clients cannot have a hairdresser at all.
Which of the following patients are registered with Dr. James Brown?
Mr. Rob Elliott
Miss Louise Flower
Mr. Henry Ford
Miss Iona Jones
What is a primary key in a relational database?
A key that opens the main database
A unique identifier for each occurrence of an entity
A key that connects two tables together
A duplicate identifier for entities
How many posts has HappyHarry created according to the image?
3
4
5
6
How many users posted post number 281792?
1
2
3
4
At National 5 level, how many types of relationships will you encounter?
one-to-one and one-to-many relationships
Only one-to-many relationships
Only one-to-one relationships
All types of relationships
What attribute is the primary key for the doctor entity in the Doctor/patient primary keys example?
doctorname
patientid
doctorid
patientname
What attribute is the primary key for the patient entity in the Doctor/patient primary keys example?
doctorname
patientid
doctorid
patientname
What attribute is the primary key for the user entity in the User/post example?
accountname
userid
postid
postcontent
What attribute is the primary key for the post entity in the User/post primary keys example?
accountname
userid
postid
postcontent
What is the purpose of a foreign key in a database?
To uniquely identify a record in a table
To establish a relationship between two entities
To store data temporarily
To increase the performance of database queries
In the hairdresser/client example, which field in the 'client' entity acts as a foreign key?
clientid
clientfirstname
hairdresserid
phonenumber
Which salon does the hairdresser with the hairdresserid '2019' work at?
West Style
On The Corner
Cuts & Co
Not listed
How many clients are associated with the hairdresserid '2210' in the 'client' entity?
One
Two
Three
Four
Which field is the foreign key in the Doctor/Patient relationship example?
doctorname
patientid
doctorid
patientname
Which of the following is a correct Doctor/Patient relationship based on the foreign key?
Dr Paul Johnson - Mr Henry Ford
Dr Wendy Reid - Mr Gordon Buck
Dr Vanessa Smith - Mrs Morag Proudfoot
Dr James Brown - Miss Iona Jones
Which field is the foreign key in the User/Post relationship example?
accountname
postid
userid
postcontent
Which of the following is NOT a correct User/Post relationship based on the foreign key?
NKSL - DAY #21 on...
GameTag101 - Want to get back into ...
WhoRYou - You know you've been...
HappyHarry - Well done Stirling...
Which symbol is typically used to indicate a primary key when listing the attributes of an entity?
#
_
*
$
Which symbol is typically used to indicate a foreign key when listing the attributes of an entity?
#
_
*
$
How many posts were added by the user "WhoRYou" according to the example?
One
Two
Three
Four
Which of the following is NOT a correct representation of an entity and its attributes?
hairdresser (hairdresserid, firstname, lastname, contactnumber, salon)
client (hairdresserid, clientid, clientfirstname, clientlastname, phonenumber)
doctor (doctorid, doctorname)
post (userid*, postid, postcontent)
Which field is the primary key for the employee table?
firstname
lastname
employeeid
telephone
Which field is a foreign key in the workbase table?
baseid
workbase
daysallocated
employeeid
On which day is the workbase 'Desk81' allocated for employee DD187?
Tuesday
Wednesday
Monday
Thursday
Which employee is associated with the telephone number 07700 955555?
Vanya Hargreaves
Eudora Patch
Rex Pennycrumb
Chuck Beaman
On which day is the workbase 'KL002' allocated for employee ED176?
Monday
Tuesday
Thursday
Friday
What type of attribute would normally store the data for the attribute 'lastname'?
Text
Number
Date
Boolean
How many characters could the attribute 'lastname' contain?
16 characters
256 characters
20 characters
Variable as depends on validation used
Which data type is used to represent numeric values that can be integer or decimal?
Text
Number
Date
Boolean
How many orders has customer Elizabeth Sherman made?
3
2
1
0
Which item did Leopold Kurtz order in the largest quantity?
Glass winter bowl
KitchenWorld oil bottle
Party 6oz glasses
Bluetooth headphones
Which customer ordered Bluetooth headphones?
Elizabeth Sherman
Abraham Sapien
Leopold Kurtz
No-one did
What is the correct data type for a surname such as "Jones"?
Text
Number
Date
Boolean
Which data type should be used for a postcode like "TD7 0EG"?
Boolean
Time
Text
Number
What data type is appropriate for an enrollment fee of "£27.50"?
Date
Number
Boolean
Time
If an attribute is "All documents received" with a value of "True", what is the data type?
Text
Date
Number
Boolean
What is the correct data type for an enrollment date like "23/03/14"?
Time
Boolean
Number
Time/Date
Which data type should be used for a time such as "19:30"?
Boolean
Date
Text
Time/Date
What data type is used for a qualification credit value of 24?
Text
Boolean
Number
Date
What is the purpose of validation in the context of data entry for an attribute?
To ensure the data entered is random
To check that the data entered for an attribute is sensible and expected
To increase the amount of data stored
To make data entry more complicated
What value will be assigned to an attribute if it fails a presence check validation?
0
Null
""
It is deleted from the database
Which type of validation rule would be appropriate for a 'size' attribute that can only take the values S, M, L, XL, XXL?
Presence check
Restricted choice
Field length
Range
What does the field length validation rule ensure?
The attribute has a value
The attribute's value is within a certain range of numbers
The attribute's text value is no longer than a specified number of characters
The attribute's value is one of a set of predefined options
What is the purpose of range validation?
To limit text attributes to a specific set of characters
To ensure an attribute's value is not Null
To restrict an attribute's value to a selection of predefined options
To limit an attribute's numeric value between a maximum and a minimum
Select the correct type of validation for the attribute "shoesizes" with UK children's shoes available in sizes 1 to 11.
Presence check
Restricted choice
Field length
Range
What type of validation ensures a password for a website is 10 or more characters long?
Presence check
Restricted choice
Field length
Range
Which type of validation is used to ensure that users accept the terms and conditions?
Presence check
Restricted choice
Field length
Range
What type of validation is appropriate for a voting response that allows users to return "Yes", "No" or "Don't Know"?
Presence check
Restricted choice
Field length
Range
What is a data dictionary?
A dictionary of technical terms.
A detailed design for one or more entities in a database system.
A collection of data samples.
A programming language.
What type of data is the 'contactnumber' attribute in the 'hairdresser' entity?
Text
Number
Date
Boolean
Which attribute in the 'client' entity is a foreign key?
clientid
clientfirstname
clientlastname
hairdresserid
What is the primary key of the 'hairdresser' entity?
salon
lastname
hairdresserid
contactnumber
Is the 'clientid' attribute in the 'client' entity a primary key or a foreign key?
Primary key
Foreign key
Both primary and foreign key
Neither primary nor foreign key
What kind of validation is required for the 'salon' attribute in the 'hairdresser' entity?
Length check
Lookup from client
Presence check
Range check
What does referential integrity ensure in a database system?
That a foreign key value entered in a table must be unique.
That a foreign key value entered in a table must exist as a primary key in the related table.
That a primary key value can be left blank.
That a table can exist without any primary or foreign keys.
In the context of the provided data dictionary, which customer has a booking for a child party on 27/07/2018?
Raymond Boyce
Edgar Codd
Larry Ellison
Safra Catz
What is the booking time for Larry Ellison's event?
12:00
11:00
12:30
14:00
Which customers are NOT having a children's party??
Raymond Boyce
Edgar Codd
Larry Ellison
Safra Catz
What does an Entity-relationship diagram (ERD) illustrate?
The programming code used in databases
The physical components of a computer system
The structure of any database
The user interface design of a database
How is an entity set represented in an ERD?
With a circle
With a triangle
With a rectangle
With an arrow
What must the name of an entity set always be?
A plural name
A singular name
An acronym
A verb
What does the "crows feet" symbol in an ERD represent?
The primary key attribute
The 'many' side of the relationship
The single entity in the relationship
The 'one' side of the relationship
How are attributes represented in an ERD?
As rectangles
As ovals
As arrows
As diamonds
How is a key attribute indicated in an ERD?
By writing it in bold
By underlining it
By italicizing it
By enclosing it in a double oval
What is the purpose of an entity relationship diagram?
To outline the logical structure of databases
To provide a step-by-step guide for database construction
To serve as a user interface for database interaction
To document the physical storage of data on a server
What does an answer table represent in the context of a query?
A collection of data that matches the requirements of the query
The initial set of data before the query is executed
A list of all possible queries within a database
The programming code used to create the query
Which of the following is NOT a component that the design of a query requires?
Tables
Fields
Search criteria
Programming languages
What is the cardinality of the relationship between 'hairdresser' and 'client' in the provided entity relationship diagram?
One-to-one
One-to-many
Many-to-one
Many-to-many
What are the fields in the 'artist' table as shown in the example database tables?
albumid, title, artistid
artistid, firstname, lastname
title, firstname, lastname
artistid, albumid, title
Which wildcard character is used to replace any number of characters in a search query?
#
%
*
?
What attribute in the 'post' entity typically serves as a primary key?
postid
userid
postcontent
timestamp
