1. Intermediate 2 Revision
Unit: Relational Databases
To use these PowerPoint Flash cards, you will need a pen
and paper.
Write down the slide number for any slide you got wrong.
Retry those slides until you can answer confidently.
Press F5 to run this presentation. 1
2. Databases can be either flat-
file or relational. State what is
meant by each of these terms.
2
3. Databases can be either flat-
file or relational. State what is
meant by each of these terms.
A flat-file database consists of one
table only.
A relational database is made of two
or more linked tables.
3
5. Explain what is meant by a
centralised database.
A database saved to a single location
5
6. State two advantages of using a
centralised database instead of
several copies of a database
saved to various standalone
computers.
6
7. State two advantages of using a
centralised database instead of
several copies of a database
saved to various standalone
computers.
Any two:
Data is easier to back up
Data is accessible to everyone
It is easier to know which is the correct version
It is easier to protect the database
7
8. Database systems are widely used to store
information that used to be held on paper. State
two advantages a computerised database has over
a manual system.
8
9. Database systems are widely used to store
information that used to be held on paper. State
two advantages a computerised database has over
a manual system.
Easier searching, less chance of damaged
or misplaced records, quicker sorting, data
analysis can be carried out, updating easier,
reporting to display results, less storage
space. etc
Award 1 mark for each correct answer to
max of 2 marks.
9
10. Explain what is meant by the
term Entity with reference to a
database.
10
11. Explain what is meant by the
term Entity with reference to a
database.
An entity becomes a table in an
electronic database.
11
12. State two advantages of using
a relational database made of
linked tables rather than a flat-
file database.
12
13. State two advantages of using
a relational database made of
linked tables rather than a flat-
file database.
Any two of these:
No data duplication
No data inconsistency
No insertion anomaly
No deletion anomaly
13
15. Explain what is meant by an
insertion anomaly.
It is not possible to enter part of a
record. All fields in a record need to be
completed to insert a new record.
15
16. Formatted output from a
database that may have been
based on a query is known
as….
16
17. Formatted output from a
database that may have been
based on a query is known
as….
A report.
17
19. State two purposes of
normalising data.
Any TWO:
To structure the data in a database
To identify the tables that will be used.
To identify the fields that will go into each
table.
To remove repeating groups/multivalued
attributes to a separate table
19
25. What is a foreign key?
A primary key from another table.
25
26. Explain why a field such as
“Customer_Name” would be
unsuitable as a primary key.
26
27. Explain why a field such as
“Customer_Name” would be
unsuitable as a primary key.
Values in a primary key must be
unique. It is possible that two
customers could have the same name.
27
29. Explain why validation is used
in a database system
To ensure that data entered into a field is
sensible
To ensure that data conforms to certain
restrictions/guidelines
To reduce errors when entering data
29
30. Below is an example of a database form or “input screen”.
State two considerations for good screen design.
30
31. Below is an example of a database form or “input screen”.
State two considerations for good screen design.
It should identify the organisation
It should allow users to access and
edit data.
It should have a consistent layout.
31
32. Explain each of these types of
validation:
(a) Restricted choice
(b) Presence check
(c) Range check
32
33. Explain each of these types of
validation:
(a) Restricted choice
(b) Presence check
(c) Range check
(a) Choice is limited to specific options
(b) The field cannot be left empty
(c) Only data between two numbers is
allowed, eg, “Enter a number between
0 and 11.”
33
35. State the type of validation
check illustrated here>
Restricted choice
35
36. “Your email address is required.
Please enter your email address”
State the type of validation check
being used in this example.
36
37. “Your email address is required.
Please enter your email address”
State the type of validation check
being used in this example.
Presence check.
37
38. Name and explain two types
of validation that could be
used on the Player ID field.
38
39. Name and explain two types
of validation that could be
used on the Player ID field.
Presence check to ensure this primary field
is not left empty.
Range check to ensure that data is between
desired values, eg > 1 and <1000
39
40. Explain how the database
would be used to display the
Player name and Average
points. The player with the
most points should be
displayed first, any players
with the same number of points
should appear alphabetically.
40
41. Explain how the database
would be used to display the
Player name and Average
points. The player with the
most points should be
displayed first, any players
with the same number of points
should appear alphabetically.
Sort (1 mark)
on attribute ‘Average points per match’ (1 mark)
in descending order (1 mark)
AND on ‘Player ID , ascending (1 mark)
Award 1 mark for each correct explanation – max 4
marks.
41
42. Describe what would need
to be done to produce a list
of all players who are not
injured and have an average
of more than 5 points per
match.
42
43. Describe what would need
to be done to produce a list
of all players who are not
injured and have an average
of more than 5 points per
match.
Search for ‘Injured’ = ‘NO’ 1 mark
AND 1 mark
‘Average points per match’ >5. 1
mark
43
44. Explain a type of validation that
could be used on the “Age” field
for the sample pupil database
shown here.
44
45. Explain a type of validation that
could be used on the “Age” field
for the sample pupil database
shown here.
Range check could be used to ensure
that a valid age is entered, eg Age >11
and <19.
45
46. Give an example of when each of
the following numeric data types
would be used in a database:
(a) Real
(b) Integer
46
47. Give an example of when each of
the following numeric data types
would be used in a database:
(a) Real
(b) Integer
(a) For decimal or fractional numbers
such as 25.75
(b) For whole numbers/counting numbers
such as Quantity: 12
47
49. Explain what is meant by a
“query”.
Processes (searching and/or sorting)
carried out to extract information from
a file
49
50. Explain how each of the following
data field types could be used in a
database:
(a) Object
(b) Boolean
(c) Link
50
51. Explain how each of the following
data field types could be used in a
database:
(a) Object
(b) Boolean
(c) Link
(a) To hold pictures or sound
(b) To hold one of two values like
true/false, male/female, yes/no
(c) To hold web addresses or links to files
51
52. State a query that
would find all the
female campers
or campers who
have taken the
course CA101.
52
53. State a query that
would find all the
female campers
or campers who
have taken the
course CA101.
Gender = Female or Course Ref = CA101
53
55. Explain how the following data has been sorted.
Sort questions are normally 2 marks; therefore, you will
be expected to describe a complex sort. Your
answer should be like this:
Sorted ascending on Gender (1 mark) AND sorted on
Surname ascending (1 mark)
55
56. The sample database
shows details of flowers
for sale. State which
Product No would be at
the top of the table when
the list is sorted by
Category in Ascending
order and by Price (£) in
ascending order.
56
57. The sample database
shows details of flowers
for sale. State which
Product No would be at
the top of the table
when the list is sorted
by Category in
Ascending order and by
Price (£) in ascending
order.
FL55
57
59. Explain what is meant by a
Boolean data type.
An item of data that can take one of two
values OR
An attribute that can only store one of two
values (True/False, 1/0, Yes/No)
59
60. Explain how the database was queried to get the results in (a).
60
61. Explain how the database was queried to get the results in (a).
These types of question are normally work 3
marks. You will be expected to answer like
this:
Do a search (1 mark)
On Make = Alpha (1 mark)
AND EngineSize=1800 (1 mark)
61
62. A doctor’s office wants to print out the
results of a query from a database.
What is the name for printed output
from a database?
62
63. A doctor’s office wants to print out
the results of a query from a
database. What is the name for
printed output from a database?
Report
63
64. Normalise the data by removing multi-valued attributes and
show how the data would be represented as two tables.
[7]
64
65. Normalise the data by removing multi-valued attributes and
show how the data would be represented as two tables.
[7]
EMPLOYEE (Employee No, Employee Name, Gender, Age, Position)
CAT_HOME(Cat_Home, City, Employee No*)
65
66. State the type of relationship that exists between
the entities that you created below.
EMPLOYEE (Employee No, Employee Name, Gender, Age, Position)
CAT_HOME(Cat_Home, City, Employee No*)
66
67. State the type of relationship that exists between
the entities that you created below.
EMPLOYEE (Employee No, Employee Name, Gender, Age, Position)
CAT_HOME(Cat_Home, City, Employee No*)
67
68. Normalise the data by removing multi-valued attributes
and show how the data would be represented as two
tables. [7]
68
69. Normalise the data by removing multi-valued attributes
and show how the data would be represented as two
tables. [7]
SHOP(Shop ID, Location)
EMPLOYEE( Employee ID, Employee
Name, Address, Position, Hourly
Wage, Shop ID*)
69
71. State two reasons for
normalising data.
Any two from
Identify which attributes belong in each table
Identify the tables that are required
Identify the relationships between the tables
Remove data duplication
Remove data inconsistency
Remove anomalies
Remove insertion anomaly
Remove deletion anomaly
Remove modification anomaly
Remove multi-valued fields 71
Identify primary and foreign keys
73. Identify one multi-valued attribute
from the database shown here.
Member ID, Member name, Date out,
date in or Fine
73
74. The Fine field is an example of a real data type.
Explain what is meant by a “real” data type.
74
75. The Fine field is an example of a real data type.
Explain what is meant by a “real” data type.
A number with a decimal or fracitonal
part
75
76. The University of Perthshire offers revision courses to help pupils prepare for
exams. The data is held in two tables as follows:
COURSE(Course ID, Title, Room, Lecturer)
PUPIL(Pupil ID, First Name, Surname, School, Contact Number, Course ID*)
Explain why the field Course ID is included in the PUPIL table.
76
77. The University of Perthshire offers revision courses to help pupils prepare for
exams. The data is held in two tables as follows:
COURSE(Course ID, Title, Room, Lecturer)
PUPIL(Pupil ID, First Name, Surname, School, Contact Number, Course ID*)
Explain why the field Course ID is included in the PUPIL table.
To serve as a foreign key
(Remember that the foreign key is a primary key in
another table.)
77
78. The example here is a database
report.
Explain what is meant by a “report”.
78
79. The example here is a database
report.
Explain what is meant by a “report”.
Formatted output from a database
used for hard copies.
79
80. Describe how the
Pupil table was
searched and sorted to
provide the information
for the report.
80
81. Describe how the
Pupil table was
searched and sorted to
provide the information
for the report.
Search for Course ID = 101 (1 mark)
Sort on school in Descending order (1
mark)
Sort on Surname in Ascending order (1
mark)
81