Professional Documents
Culture Documents
Marking Scheme
b) Name 2 data models that pre-date (came before) the relational model. [2 marks]
1 each for any 2 of: File-based processing model, Network model, Hierarchical
model
c) Describe the characteristics of the 2 data models you named for part (b). Use
examples to back up your answers. [8 marks]
File-based (1 mark for each point, to a max of 3; 1 for good examples):
Flat text files (.5); data grouped into records (.5)
File = an entity e.g. Customer in a bank system (.5); row of text = a record;
file = a record type (.5).
Programmers – specific programs to access data/carry out tasks (.5); a lot
of work – different tasks need different programs (.5)
Data duplication in different files (1)
Hierarchical model (1 mark for each point, to a max of 3; 1 for good examples):
Recognition that data in a system related to other data in the same system –
can be modelled in a hierarchy (1)
Can model 1-M relationships e.g. Customer has Accounts, Account contains
transactions (1)
Tree structure used to store data (.5) – records of data, links between them
– showing parent-child relationships (.5)
Record types for entities e.g. Customer (.5); data records in flat files (.5)
Network model (1 mark for each point, to a max of 3; 1 for good examples):
Records & links between them (.5)– chained together in a network (.5)
Record types for entities e.g. Customer (.5); records of the types stored in
network (.5)
Relationships modelled as sets (.5) – of 1 owner record type & >= 1
member record type (.5) e.g. Customer & Accounts
Page 1 of 6
A set occurrence relates one record of the owner record type to a set of
records of the member record type (1)e.g. Customer X has accounts A & B.
d) Why do you think the relational model is so widely used today? [3 marks]
Looking for demonstration/application of learning here – student should show why
they think relational model is better than previous models. Model answer below –
with points for which 1 mark each can be awarded highlighted in bold:
Possible superkeys:
(ass_sequence, crs_code) – because the sequence number is unique for the course.
(ass_code, ass_desc) – because ass_code is unique for the course
[any combination of attributes that includes ass_code or ass_sequence & crs_code is a
valid super key. Give 5 marks for any 2 combinations that meet this criteria.
Give 1 mark for ass_code on its own.
Give 0 marks for any other attribute on its own – as no other attribute uniquely
identifies tuples.
If the same attribute is specified in both answers e.g. ass_code or
ass_sequence/crs_code – deduct 1 or 2 marks – depends on actual answers.
c) Based on your answer to part (b), identify 2 candidate keys for Assignment-
Schema. Justify your answer by saying why your choices are candidate keys. [4
marks]
1 mark – answer are the minimal super keys based on answers to part b.
Page 2 of 6
1 mark – ass_code
1 mark – ass_sequence,crs_code
1 mark – they are candidate keys because they are minimal super keys i.e. subsets of a
super key for which there are no more subsets that are super keys.
d) Of the candidate keys you have selected in part (c), which would you choose to be
the primary key? Why? [2 marks]
Choose ass_code (1 mark) because it is less likely to change over time( sequence
number can be changed) (1 mark).
Diagram should look something like the one shown below (this one has slightly different
attribute names – should be the attribute names given in the question).
Page 3 of 6
(i) Write a relational algebra expression to list all orders for January 2005 (note
that the dates are in the format dd/mm/yyyy). [1 mark]
OrdDate >= 1/1/2005 OrdDate <= 31/1/2005 (Order)
.5 for correct operator on correct relation, .5 for correct use of logical AND
(ii) Write a relational algebra expression to list the CustNo, CustName and
CustFathersName for all customers. [1 mark]
CustNo, CustName, CustFathersName (Customer)
1 for correct operator on correct relation
(iii) Write out the tuples that will be in the result of a projection operation to list the
CustKebele and CustTown attributes from the Customer relation. [1 mark]
(iv) Write a relational algebra expression to show all orders, with the details of the
employees associated with them (using one operator). [1 mark]
Order Employee (natural join)
(vi) Show the 3 steps to derive the operation used in (iv), using the basic relational
algebra operations. Explain each step. [3 marks]
(1) Cartesian Product: Order x Employee
(1) Selection (to get only the matching rows): Order.EmpNo=Employee.EmpNo (Order x
Employee)
(1) Projection (to eliminate one of the EmpNo attributes):
OrdNo,OrdDate,CustNo,Order.EmpNo,EmpName,EmpFathersname,EmpPhone (Order.EmpNo=Employee.EmpNo (Order x
Employee))
(vii) What relations must be combined to show the OrdNo, OrdDate and ProdName
in the resulting relation? [2 marks]
Order, Product, OrderLine (1 for OrderLine, .5 each for Order, Product)
(viii) What relational algebra operator would you use to find products that are
contained in any order (the OrderLine relation shows the products contained in
an order)? [1 mark]
Page 4 of 6
Natural Join
(ix) What relational algebra operator would you use to find products that are
contained in every Order (the OrderLine relation shows the products contained
in an Order)? [1 mark]
Division
(x) Write a relational algebra expression to find how many orders each customer
has made. [2 marks]
CustNoGcount(OrdNo) (Order)
Uses aggregagte/summarise operator, count function on any attribute except
CustNo, grouped on CustNo.
1 mark – G operator; .5 for CustNo, .5 for count (x)
4. [9 marks total]
The E-R diagram in Figure 1 below is for the following system.
Em ployee
EmpID Project
EmpName assigned_to ProjCode
EmpPhone ProjName
ProjStartDate
is_in
has
Departm ent
Phase
DeptID
DeptName PhaseName
EndDate
StartDate
Figure 1 – E-R Diagram
Page 5 of 6
Because an instance of Employee can be related to a maximum of one instance of
Department. (1 mark)
Max cardinality is 1 (1 mark)
c) Give an example of existence dependency from the diagram above – specify the
entity and the relationship that it is existence dependent on. [1 mark]
Department is existence dependent on the has relationship.
Or Project/has, Phase/has, Department/is_in, Employee/is_in
.5 for the Entity, .5 for the relationship
d) Explain why the example you gave is an example of existence dependency. [2
marks]
Because the min cardinality is 1, meaning that an instance of Department must be
related to at least one Employee instance (or appropriate entity/relationship).
[2 marks]
END OF EXAM
Page 6 of 6