Exam Paper Answers 1999/2000 and 2000/2001 |
These answers may not be correct so don't just take my word for it! Do the questions yourself by cheating and using your course notes and books. If they look like mine, then the chances are quite good that we are both correct. It does not matter if it takes you more than one hour for each question, the fact you have got an answer will stick in you mind and will help during the real exam.
Learn to read the question properly and only answer what is asked and not what you think they want. Don't forget to do all the parts of each question. Explain any assumptions you have made if the question is not clear. Read all the questions before you write anything down, there may be an easier one further down the paper. Tick off the ones you can answer as you read the paper, then go back and assess which will be the best question to start with.
I have looked at both of these past papers and there is a common theme of 6 questions from which you must select 4. There is no compulsary question so you can just cross out the two you don't like in the exam. All questions are worth the same 25 marks (hence 4 = 100%) although the sub questions do vary the the marks they attract. I cannot see any parts with less than 1 mark although some of the larger ones do attract 10 or more on occasion.
The questions usually group all their parts around a common subject area so there should be no rogue parts to these questions.
In common with previous exams I have assumed that you get a point for each statement, bullet point or sentence that gives a complete answer and uses all the buzz-words. If your answer does not do this only expect half a point per statement. Sometimes it is easier to draw a diagram than try to describe something in words (an EERM for instance). In this case you will get marks for every correct physical object drawn, and every correct label that explains what it is.
Keep an eye on the time, there are 4 questions to answer in 3 hours that's 15 mminutes to read the paper, 37 minutes per question and 15 minutes checking at the end. That works out at about 90 seconds per mark, so if you are still working on a 3 mark question after 5 minutes, stop, leave a few lines blank and go back to it at the end.
I have not bothered to repeate the questions before I answer them. Please print out the exam papers by downloading the zip file in the DS Index page. This contains two PDF files, one of each exam paper.
|
1.a(1 mark) |
(reminder) Answer |
|
1.a(2 marks) |
(Integrity Rules) Entity Integrity: A Primary Key must be a non-null value that identifies just one row in the table. Relational Integrity: A Foreign Key must be either wholely null or a value that exists as a Primary Key value in the referenced (parent) table or relation. |
1.b(1 mark) |
(Meaning of NULL) It indicates that the managers salary is unknown or unspecified. |
1.c(4 mark) |
(Violations)
|
1.d(2 mark) |
(Relational Algebra) They are not the same. Expression ii is invalid because the conditional statement contains an attribute not in the (virtual) projection of the staff table. |
1.e(2 mark) |
(Relational Algebra + SQL)SELECT view-date FROM viewing WHERE prop-no = 4; |
1.f(4 mark) |
(Relational Algebra + SQL)SELECT staff-no FROM staff WHERE position = 'manager' AND salary > 25000; |
1.g(6 mark) |
(Relational Algebra + SQL)SELECT S.telephone FROM staff S, branch B, property P, viewing V WHERE B.branch-no = S.staff-branch AND P.prop-no = V.prop-no AND S.staff-no = V.staff-no AND P.type = 'flat' AND P.rooms > 2 AND V.view-date < sysdate; |
1.h(4 mark) |
(Relational Algebra) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2.a(3 mark) |
(Concept, Physical, Logical design) Conceptual Design is a model of the real-world objects that is understandable by the customer community. Logical Design is the implementation independant list of database objects (tables) that represents the Conceptual model. Physical Design is the implementation specific design details of indexes, files, disks, blocks, etc where the database is actually stored. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2.b(4 mark) |
(ER Diagram)![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2.c(4 mark) |
(Existence List) An Existence Entity is a look-up table. It contains (as a minimum) a single attribute whose values map into the domain for the attribute. A good example in the case study is a list of valid property types for the TYPE domain of the PROPERTY table.
A second example would be POSITION which would contain a list of valid company positions for staff, such as: manager secretary, agent. In both cases the existence entity becomes a check constraint on the legal values for that attribute enforced by a Foreign Key constraint of the referencing table against the Primary Key on the domain existence entity. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2.d(6 mark) |
(EERM) The EERM brings inheritance to the ERM by allowing Super and Sub Classes, Aggrigation and Composition (Association). For instance, in the case of the STAFF entity, there may be some attributes which only relate to some staff types as follows:
At the top is the SuperClass with the common attributes of StaffNo and StaffName, at the bottom are the SubClasses showing their specialisations by exhibiting differential attributes. Each of the SubClass entities would inherit the common attributes from the SuperClass entity (STAFF). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2.e(8 mark) |
(Physical Design Activities)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.a(1 mark) |
(Views) A View is stored in the DBMS as a text string of it's definition, not a collection of data as is a real table. When a view is queried the RDBMS merges the where part of the view difinition with the where of the query to prouce a run-time query which is then executed. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.b(4 mark) |
(Reasons for Views) The two main reasons for Views are Security (Read Only Views) and convenience (preconfigured queries and joins). To make a Read Only view, reference the base table but leave out any mandatory not-null attribute (usually the Primary Key). EG: CREATE VIEW staff-branch
(employee, job, branch-id)
AS SELECT name, position, staff-branch
FROM staff;
Note the ability to change column names between the view and the base tables. Pre-configured join to find which properties are assigned to branches. EG: CREATE VIEW branch-prop
(branch-no, prop-no, type, rooms)
AS SELECT B.branch-no,
P.prop-no,
P.type,
P.rooms
FROM branch B
property P
staff S
viewing V
WHERE B.branch-no = S.staff-branch
S.staff-no = V.staff-no
V.prop-no = P.prop-no;
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.c(3 mark) |
(Views) The view is not updateable, as it does not contain the primary key from the base table. As the primary key (by definition) is a not-null field, attempting to insert a row through the view leaving the primary key blank will violate the Primary Key entity constraint. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.d(4 mark) |
(Views) Create a view such as:
CREATE VIEW staff-salary
(name, salary, type)
AS SELECT name, salary, position
FROM staff
WHERE position <> 'manager';Then query the view thus:
SELECT * FROM staff-salary WHERE type = 'agent'; This would resolve into the following base table query:
SELECT name, salary, position AS 'type' FROM salary WHERE position <> 'manager' AND position = 'agent'; Which would list details of names and salaries of AGENT staff only. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.e(6 mark) |
(ANSI-SPARC Architecture)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.f(3 mark) |
(External Schema - View) A "staff CREATE VIEW staff There would be one view for each staff member with its name including the staff number of each member. Where queried the view would list out all the visits for that day for the enquiring staff member. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3.g(4 mark) |
(Phisical Data Independence) The ANSI-SPARC Architecture limits the disruption casued in layers above by changes in the layers below. Physical Data Independence means that changes to the physical level will not be visible to conceptual or the user lelevs. So changes to file layouts and disk drive organisations should have no effect on the table structures, likewise, changes to the indexing schemes should have no effect on (require no changes to) the application layers. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4(25 mark) |
(Roles) This question is asking about roles which were not covered in this years syllabus. You can answer only parts of the is question. I just didn't bother. Q 4.c is the only part you can completely answer with the knowledge gained this year. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5.a(6 mark) |
(Transactions - ACID)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5.b(4 mark) |
(Locks) Any SELECT statment would automatically set a share lock. EG:
SELECT * FROM staff; Any INSERT, UPDATE, DELETE statement would set an exclusive lock. EG:
UPDATE staff SET salary = salary * 1.1 WHERE position = 'agent'; The purpose of the share lock is to make sure the RDBMS is aware that a transaction is looking at some data. It can then be alert for read-consistancy if a new transaction attempts to apply an exclusive lock to the same object. The exclusive lock is used to stop the lost-update problem. A transaction attempting to put an exclusive lock on an object that already carries an exclusive lock, must wait for the object to become free or else timeout. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5.c(3 mark) |
(2PL) The two phase locking protocol consists of a growing phase when locks can be acquired and a shrinking phase during which locks can be released. During the growing phase no locks can be released and during the shrinking phase, no more locks must be acquired. 2PL guarantees:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5.d(4 mark) |
(Transaction Diagrams) Lost Update:
Two Phase Locking:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5.e(5 mark) |
(Wait-For-Graph) This diagram is a wait-for-graph (WFG) representing a deadlock. Each of the transactions in the diagram is waiting for resources currently held (or locked) by another transaction. The RDBMS must be able to detect deadlocks and resolve them. There are three usual methods for detecting deadlock: timeout, wait-die, wound-die. The DBMS creates and maintains WGF's to enable detection and resolution. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5.f(3 mark) |
(Locks) Because if the SELECT query is long running, it needs to be sure of getting "read-consistent" data even if a short UPDATE transaction affects a few rows in the queried table between the SELECT starting and completing its read operation. Do we need further examples or is that enough for 3 marks...? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6.a.(i)(4 mark(2)) |
(Candidate Key) A Candidate Key is a single or multiple attribute which can uniquely identify one row in a table. Several Candidate Keys may exist in a table and from these one is selected to become the Primary Key. In the PROPERTY table both prop-no and address could be considered as Candidate Keys. The attribute prop-no was chosen to be the Primary Key because the field length is shorter and results in a more efficient implementation. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6.a.(ii)(4 mark(2)) |
(Functional Dependency) Functional Dependency relates to how attributes are related (connected) to a table. It is usually (but not always) a one-way relationship as follows: staff-no The attribute staff-name is dependant on staff-no. But the reverse is not true as two staff with the same name could exist and they would have different staff-no values. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6.b(4 mark) |
(BCNF) Every determinant is a candidate key. subject + student
tutor
tutor
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6.c(4 mark) |
(Hidden Attributes) Can anyone find the definition for this question - it is not mentioned in the index to Connolly...? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6.d(8 mark) |
(Unknown Values) In the handout it states CODDS rules do not handle "unknown" values. So the NULL value is something that was thought of to make RDBMS implementations possible. What do they want here? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6.e(2 mark) |
(Natural Join)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6.f(3 mark) |
(Maybe Join [outer join ?])
|
|
Only Joking!
|
|
|
|
|
|
|
|