Sei sulla pagina 1di 14

Databases

2 September 2015

Marking Scheme
This marking scheme has been prepared as a guide only to markers. This is not a set of
model answers, or the exclusive answers to the questions, and there will frequently be
alternative responses which will provide a valid answer. Markers are advised that, unless a
question specifies that an answer be provided in a particular form, then an answer that is
correct (factually or in practical terms) must be given the available marks.

If there is doubt as to the correctness of an answer, the relevant NCC Education materials
should be the first authority.

Throughout the marking, please credit any valid alternative point.

Where markers award half marks in any part of a question, they should ensure that
the total mark recorded for the question is rounded up to a whole mark.
Answer ALL questions

Marks
Question 1

a) State FIVE (5) examples of how an educational institution (such as a school or 5


college) could use a database.

Award 1 mark for each bullet point up to a maximum of 5 marks

 Class lists
 Timetabling
 Staffing
 Payroll
 Exam scheduling
 Library systems.

Note: Credit alternative valid answers.

b) This question concerns the functions of a database management system


(DBMS).Briefly explain the terms:

i) Administration Utilities 1

Administration Utilities - Allow importing and exporting of data,


monitoring of use and monitoring of performance.
ii) Data communication 2

Data Communication - To be able to interact with other software


enabling connections to other parts of an ICT system. (1 mark) This
enables connection between the kernel and the toolkit software (1
mark).
iii) Data integrity 2

Data Integrity - Making sure that the database data reflects accurately
the model of the world that data is being kept about (1 mark) This
involves the use of integrity constraints, such as enforcing that the
values of an attribute are valid values. (1 mark)

Total: 10 Marks

Page 2 of 14
Databases © NCC Education Limited 2015
Marks
Question 2

Consider this scenario: A machine repair company uses engineers to carry out
tasks. An engineer may be allocated one or more tasks at a time. Some tasks will
require more than one engineer allocated to them.

a) Draw an Entity Relationship Diagram for this scenario. 5

The maximum number of marks awarded for this question is 5. Award 1


mark for each correct entity up to a maximum of 3 marks. Award 1 mark for
each correct relationship up to a maximum of 2 marks. Alternative names
for entities are acceptable e.g. ‘Staff’ for ‘Engineer’, ‘Job’ or similar for
‘Task Allocation’, ‘Job Type’ for ‘Task’.

b) Produce the data dictionary for this ER model using primary and foreign keys 5
with appropriate attributes.

Engineer
EngineerID(PK)
Name

Task
TaskCode(PK)
TaskDescription

TaskAllocation
Engineer(PK)(FK)
TaskCode(PK)(FK)

The total number of marks for this question is 5. Award 1 mark for each PK
in Engineer and Task up to a maximum of 2 marks. Award 1.5 marks for
each PK/FK pair in Task Allocation up to a maximum of 3 marks.

Total: 10 Marks

Page 3 of 14
Databases © NCC Education Limited 2015
Marks
Question 3

a) Entity Relationship modelling has been described as a ‘top-down’ approach to 2


data modelling. Briefly explain what is meant by a ‘top-down’ approach to data
modelling.

Award 1 mark for each bullet point up to a maximum of 2 marks

 Identifying entities by trying to understand the main items of


significance about which data is kept.
 Starting with general concepts before breaking down to look at
particular details of data kept.

Note: Credit alternative valid answers. For example, a contrast with bottom-
up approaches such as normalisation.

b) Briefly explain the following concepts and provide ONE (1) example of each
concept.

i) Simple Attribute 2
Award 1 mark for the explanation and 1 mark for the example up to a
maximum of 2 marks.

It is composed of a single component. For example 'Sex' is just one


value for any occurrence.

ii) Composite Attribute 2


Award 1 mark for the explanation and 1 mark for the example up to a
maximum of 2 marks.

It is composed of more than one component. For example, 'Address'


might have address lines, town, post or zip code.

iii) Single-Valued Attribute 2


Award 1 mark for the explanation and 1 mark for the example up to a
maximum of 2 marks.

It holds a single value for an occurrence of an entity type. Again, 'Sex'


is a good example because there will only be one value.

iv) Multi-Valued Attribute 2


Award 1 mark for the explanation and 1 mark for the example up to a
maximum of 2 marks

It is where there might be more than one value for a given occurrence
of an entity type. For example, 'Telephone Number' where a person or
business might have many of these.

Total: 10 Marks

Page 4 of 14
Databases © NCC Education Limited 2015
Marks
Question 4

a) Identify THREE (3) problems that the duplication of data can cause in a database 3
system.
This wastes space (1 mark) and also raises the more serious problem of
compromising data integrity (1 mark) whereby data in one relation way
contradict the duplicated data in another relation (1 mark)

b) Outline ONE (1) example of duplication of data within a database system. 2


For example, a customer’s name, address and phone number might be
stored many times over (1 mark). This might be stored in the customer’s
file and once again every time they make a rental (therefore possibly many
times in the rental file) (1mark)

Note: Credit valid alternative examples

c) How would a database developer ensure that data duplication is avoided during 2
the development process?
By undertaking normalisation (1 mark) with relations normalised to at least
3rd normal form (1 mark)

d) Explain why relational databases can be described as ‘self-describing’. 3


In addition to the user’s source data, a database contains a description of
its own structure. (1 mark) This description is held by metadata (1 mark)
and is held in a set of tables known as the data dictionary (1 mark).

Total: 10 Marks

Page 5 of 14
Databases © NCC Education Limited 2015
Marks
Question 5

a) State FOUR (4) objectives of SQL. 4

Award 1 mark for each bullet point up to a maximum of 4 marks

 Create the database and relation structures


 Perform basic tasks, such as insertions/updates of data from base
relations
 Perform deletions of data from base relations
 Perform simple and complex queries.

Note: Alternative answers that mention DDL and DML should be credited.

b) Consider the following SQL command: 6

Select e.first_name, e.surname, d.department_name


From Employees as e, departments as d
Where e.department_no = d.department_no
And e.surname like ‘B%’
Order by e w.surname

State the functions of the different SQL commands that are used in this
statement.
The maximum number of marks awarded to this question is 6. Award 1
mark for each bullet point:

• ‘Select’ outlines which columns are to be retrieved.


• ‘From’ defines from which tables the data is to be retrieved.
• Tables are given an alias with the use of a letter after the table name.
• ‘Where’ clause here contains a join condition that links the two tables.
• ‘And’ clause is another where clause defining some additional criteria.
• The ‘Order By’ clause specifies the order in which the results will be
presented in.

Total: 10 Marks

Page 6 of 14
Databases © NCC Education Limited 2015
Marks
Question 6

a) A table Customer_Purchase is the intersection table between two other tables, 6


Customers and Items. It also stores the purchase date and a payment total.
Write the SQL create script to create this table on a database.
CREATE TABLE Customer_Purchase
(
ItemNo char (4) not null,
CustomerNo char (4) not null,
PurchaseDate date
PaymentTotal decimal
PRIMARY KEY (ItemNo, CustomerNo),
FOREIGN KEY (CustomerNo) REFERENCES Customer(CustomerNo)
FOREIGN KEY (ItemNo) REFERENCES Purchase(ItemNo) );

The maximum number of marks awarded to this question is 6. Award 1


mark for each bullet point:

 Specify ‘create table’ key words.


 Listing attributes correctly
 Specifying ‘primary key’ key words
 Specifying composite primary key
 ‘Foreign key’ key words
 Specifying foreign keys correctly

b) Briefly explain the term foreign key and provide ONE (1) example of the term. 2

Award 1 mark for the explanation and 1 mark for an example, up to a


maximum of 2 marks.

A foreign key is an attribute that is a ‘duplicate’ or ‘copy’ of a candidate key


value in another table. Example of a foreign key: in a relationship where the
table Customer has many Orders. The primary key of Customer (e.g
CustomerID) will become a foreign key in the Order table.

Note: Credit alternative valid explanations.

c) How could a foreign key be enforced on a database system? 2

Award 1 mark for each bullet point up to a maximum of 2 marks.

• In a database system, it should be enforced that a foreign key that is


linked to a primary (or candidate) key on another table only contains values
that are in that table.
• This is enforced by a foreign key constraint.

Note: Credit other valid points. This includes: when a constraint can be
created (during table creation or later with an alter table command).

Total: 10 Marks

Page 7 of 14
Databases © NCC Education Limited 2015
Marks
Question 7

Consider the following tables for recording participants in athletics competitions in


England. Each administrative centre is assigned to one or more regions. The tables
show regions, administrative centres and the regions that have been assigned to
centres.

AdministrativeCentre
CentreCode CentreName
LON London
NOR Norwich
LIV Liverpool
SHE Sheffield

Region
RegionName NumberOfAthletes
EastEngland 30,123
NWEngland 154,367
SEEngland 28,450
Midlands 56,093

RegionCentre
CentreCode RegionName
LIV NWEngland
NOR EastEngland
LON SEEngland
NOR Midlands

a) Briefly explain how this database structure implements the fact that an 3
administrative centre can be allocated to more than one region and show how
this is represented in the database.

Award 1 mark for each bullet point up to a maximum of 3 marks

 There is a many-to-many relationship already here between


administrative centres and regions.
 This is represented on the RegionCentre table.
 For an administrative centre to be allocated different regions would just
mean additional rows on this table.

Question 7 continues on next page


Page 8 of 14
Databases © NCC Education Limited 2015
b) Write an SQL statement to select the administrative centre in the region with the 4
largest population.

Award up to 4 marks for a correct solution:

Select C.CentreName (1/2 mark)


From AdminstrativeCentre C, Region R, RegionCentre RC (1/2 mark can
use ‘as’ to create aliases)
Where C.CentreCode = RC.CentreCode (1/2 mark)
And RC.RegionName = R.RegionName (1 mark for two parts of join
condition)
And R.RegionName in (Select R.RegionName) (1/2 mark)
From Regions where population = (select max(population from region)) (1
mark for subquery)

c) Write the SQL to insert a row to record a new region, EnglandWest with 34,090 3
athletes.

Award up to 3 marks for a correct solution:

Insert into Region (1 mark)


Values (‘EnglandWest’,34090); (1 mark for use of ‘Values’, 1 mark for actual
values)

Total: 10 Marks

Page 9 of 14
Databases © NCC Education Limited 2015
Marks
Question 8

a) What is conceptual design? 2


Conceptual design – This examines the data needs and constructs of an
organisation (1 mark) but without assuming any particular data model will
be used (1 mark).

b) Outline TWO (2) features of logical database design. 2


Logical Database Design - Constructs the model without regard for the
particular DBMS that will be used (1 mark) However, the data model (e.g.
the relational model) is known (1 mark).

c) Describe how you would move from a set of logical entities to a detailed physical
design. You should say how you would proceed to represent the following parts
of the logical design:

i) Entities where there is a one-to-one mapping to a table 1


Those entities where there will be a one-to-one mapping of entities to
tables will become a table in the database

ii) Many-to-many relationships 1


Decomposing many-to-many relationships. Where many-to-many
relationships exist in the ERD, these should be decomposed

iii) Domains 4
Representing domains as separate tables (1 mark). Some domains
should be implemented as separate tables known as look-up tables (1
mark). The number of values, and how dynamic the data is, are issues
here. If there are a large number of values in a domain and it is likely
that these will be added to or updated, then it likely that these should
be implemented as a separate table (1 mark). Otherwise they could be
implemented as a constraint (1 mark).

Total: 10 Marks

Page 10 of 14
Databases © NCC Education Limited 2015
Marks
Question 9

The following tables have been set up in a database for a system of appointments for
a literary agent

0… 1
4
Agent Appointment Author
1 0…
4

a) Create a CRUD matrix to show the following transactions: 6

Transaction 1. Add a new Appointment.


Transaction 2. Delete an old Appointment
Transaction 3. Record the details of a new Agent
Transaction 4. Show a list of Author’s details and the Appointments they have
had and with which Agents.
Transaction 5. Update an Author’s address
Transaction 6. Delete an Author.

The total marks awarded for this question is 6. Award 1 mark for each
correct row in a table similar to the one shown below.
Transaction /Table Agent Appointment Author
T1 C
T2 D
T3 C
T4 R R R
T5 U
T6 D

Question 9 continues on next page

Page 11 of 14
Databases © NCC Education Limited 2015
b) Briefly explain how users who require different access levels can be supported 4
and provide TWO (2) examples of this support using the Literary Agent system
above.

Award 1 mark for each bullet point up to a maximum of 4 marks

 Different access levels can be supported by using roles.


 An example of a role would be ‘Ordinary User’ , another could be
‘Administrator’.
 These grant different levels of access depending on the role.
 An example is: ‘Ordinary User’ might be granted the ability to view
(Select) data; ‘Administrator’ might be granted more wide ranging
permissions (Full CRUD) select, insert, update and delete.

Note: Credit answers such as those that detail the GRANT and REVOKE
commands.

Total: 10 Marks

Page 12 of 14
Databases © NCC Education Limited 2015
Marks
Question 10

Consider the following table for a hotel database to keep track of guests and their
type of payment (card or cash). It has been created in SQL:

Table Name: Guests


Attributes:
GuestNo Integer
GuestLastName Varchar(30)
GuestFirstName Varchar(30)
GuestDOB Date
PaymentType Varchar(5)

a) Write an SQL statement that inserts a new guest called Harry Cripps, whose 4
guest number should be ‘801’. Harry was born in 1941, on the 29th April. He pays
with cash.

Award up to 4 marks for a correct solution

Insert into Guests (1 mark for ‘Insert’, 1 mark for correct table)
Values (801,‘Cripps’,’Harry’,’29-APR-1941’,’Cash’) (1 mark for ‘Values’, 1
mark for actual values)

Note: Date formats can vary.

b) Write an SQL script that changes Harry’s payment type to ‘Card’. 3

Award up to 3 marks for a correct solution:

Update Guests (1 mark)


Set PaymentType = ‘Card’ (1 mark)
Where ResidentNo = 801(1 mark)

Up to 3 marks for this script.

c) Write an SQL statement to change the datatype of the GuestNo to Varchar 3

Award up to 3 marks for a correct solution:

Alter table Guest (1 mark)


Modify column GuestNo varchar (1 mark for ‘Modify Column’, 1 mark for
specifying column name and datatype)

Total: 10 Marks

End of Examination Paper

Page 13 of 14
Databases © NCC Education Limited 2015
Learning Outcomes matrix

Question Learning Outcomes Marker can differentiate


assessed between varying levels of
achievement
1 1 Yes
2 1,4 Yes
3 3 Yes
4 2 Yes
5 5 Yes
6 5 Yes
7 5 Yes
8 4 Yes
9 3 Yes
10 5 Yes

Grade descriptors

Learning Outcome Pass Merit Distinction


Understand the Demonstrate Demonstrate Demonstrate highly
concepts associated adequate level of robust level of comprehensive level of
with database understanding understanding understanding
systems
Understand the Demonstrate Demonstrate Demonstrate highly
concepts associated adequate level of robust level of comprehensive level of
with the relational understanding understanding understanding
model
Understand how to Demonstrate Demonstrate Demonstrate highly
design and develop adequate level of robust level of comprehensive level of
a database system understanding understanding understanding
Be able to develop a Show adequate Show sound and Show innovative and
logical database development appropriate highly appropriate
design development development
Be able to develop a Show adequate Show sound and Show innovative and
database system development appropriate highly appropriate
using SQL development development

Page 14 of 14
Databases © NCC Education Limited 2015

Potrebbero piacerti anche