Sie sind auf Seite 1von 40

._.

Section A

.,_

SectJ1'Ql"". ~ ..S<:ct BJ'J3

Sect B Q1

~.1\, l

'

,.\

-.:

-!":,'.

.'~ :1~ (.1 : ,"i;~

~.

<"t !,',

....-

(.

"t.,

S~BQ4

.-'

~\

Office Use Only


Sect B Q6
Sect B QS

\1\

):<'l
./

,f

Semester One Examination Period 2012


Faculty of Information Technology
EXAM CODES:

FIT1004

TITLE OF PAPER:

Data Management

EXAM DURATION:

3 hours writing time

READING TIME:

10 minutes

~fl i l l lfl i~lil ~lf~l l ili~lil


004211716

THIS PAPER IS FOR STUDENTS STUDYING AT:( tick where applicable)


D Berwick
D Clayton
D Malaysia
D Off Campus Learning
1&1 Caulfield D Gippsland
D Peninsula
D Enhancement Studies
D Pharmacy D Other (specify)

D Open Learning

D Sth Africa

During an exam, you must not have in your possession, a book, notes, paper, electronic device/s,
calculator, pencil case, mobile phone or other material/item which has not been authorised for the
exam or specifically permitted as noted below. Any material or item on your desk, chair or person will
be deemed to be in your possession. You are reminded that possession of unauthorised materials in an
exam is a discipline offence under Monash Statute 4.1.

No examination papers are to be removed from the room.


Attempt all questions. All answers must be printed neatly on this paper. Answer questions with
concisely expressed factual information. The backs of pages in this paper may be used for any rough
work. Any material written on the backs of pages will not normally be marked. If an answer
needs to overflow from its designated answer space to a blank page, clearly indicate that this is the
case and that the material on the blank page is for correction. This paper must be handed up at the end
of the examination, even if no questions are attempted. The marks for each question are shown. Total
marks for the examination: 100. This exam counts as 50% of the final assessment for the unit.

AUTHORISED MATERIALS
CALCULATORS

DYES

lXI NO

OPEN BOOK

DYES

1&1 NO

SPECIFICALLY PERMITTED ITEMS

DYES

1&1 NO

Candidates must complete this !iection

STUDENT ID

DESK NUMBER

Page 1 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 2 of 40

Section A:

Multiple Choice Section

This section is worth 10 marks. Each question is worth 0.5 mark.


Mark your selection by placing a,; or a X through your selected answer
for example 6 or X
If you change your selection during the review of your paper, prior to the end of
the Examination, make sure that the alteration is clear.
Note: There is only ONE correct answer for each question.
Multiple Choice
Identify the choice that best completes the statement or answers the question.

1.
Since it is used to link the tables that originally were related in a M:N relationship, the
composite entity structure includes-as foreign keys-at least the _ _ keys of the tables that
are to be linked.
a. composite
c. pnmary
b. super
d. umque

2.
The special operator used to check whether an attribute value is within a range of
values is
a. BETWEEN
c. LIKE
b. NULL
d. IN

3.
Accurate, relevant, and timely information is the key to _ _ .
a. data management
c. knowledge
d. understanding
b. good decision making

4.
As long as two transactions, Tl and T2, access __ data, there is no conflict, and the
order of execution is irrelevant to the final outcome.
a. shared
c. umelated
b. common
d. locked

5.
a.
b.
c.
d.

ANSI defines four events that signal the end of a transaction. Of the following events,
is defined by ANSI as being equivalent to a COMMIT.
Five SQL statements are executed.
The end of a program is successfully reached.
The program is abnormally terminated.
The database is shut down for maintenance.

6.
A table that is in 2NF and contains no transitive dependencies is said to be in _ _ .
a. lNF
c. 3NF
b. 2NF
d. 4NF

Page 3 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 4 of 40

7.
a.
b.
c.
d.

When designing a database, you should __ .


make sure entities are in normal form before table structures are created
create table structures then normalize the database
only normalize the database when performance problems occur
consider more important issues such as performance before normalizing

8.
The SQL aggregate function that gives the total of all values for a selected attribute in
a given column is __ .
a. COUNT
c. MAX
b. MIN
d. SUM

9.
A
should be a derived attribute.
a. Person's name
c. Person's social security number
b. Person's age
d. Person's phone number

10.
BCNF can be violated only if the table contains more than one __ key.
a. pnmary
c. foreign
b. candidate
d. secondary

11.
__ are important to ensure data integrity.
a. Attributes
c. Relationships
b. Entities
d. Constraints

12.
All primary key entries are unique, and no part of a primary key may be __ .
a. zero
c. null
b. a foreign key
d. a candidate key

13.
If an employee within an EMPLOYEE entity has a relationship with itself, that
relationship is known as a __ relationship.
a. self
c. looping
b. self-referring
d. recursive

14.
A(n) __ represents a particular type of object in the real world.
a. attribute
c. relationship
b. entity
d. constraint

15.
The most likely data type for a surrogate key is __ .
a. Character
c. Logical
b. Date
d. Numeric

Page 5 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 6 of 40

16.
The Oracle
a. DATE
b. SYSDATE

17.
Lock
a. granularity
b. shrinking

function returns the current date.


c. CURRENT DATE
d. TO DATE

indicates the level of lock use.


c. growmg
d. serializability

18.
In Oracle, __ makes it possible to merge SQL and traditional programming
constructs, such as variables, conditional processing (IF-THEN-ELSE), basic loops (FOR and
WHILE loops,) and error trapping.
c. embedded SQL
a. triggers
d. procedural SQL
b. indexes

19.
A(n) __ phase in a two-phase lock is when a transaction releases all locks and
cannot obtain any new lock.
c. locking
a. growmg
b. shrinking
d. unlocking

20.
A __ is a logically connected set of one or more fields that describes a person, place
or thing.
a. database
c. record
d. file
b. column
[20 x 0.5 = 10 marks]

Page 7 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 8 of 40

Section B:

Short Answer Section


This section is worth 90 marks.

Question 1 Formats, metadata and data quality

(10 marks)

(a) The following table shows a sample data record from an Australian botanical collection:

Source institute
Accession number
Scientific name
Collection
Collection number
Additional collectors
Region
Near named place
Location
Geocode source
Geocode precision
Record update date

CANS
564849
Eucalyptus regnans F.Muell.
Nicolle, D.; 02-Jan-2002 , Field collection
4316
None
Victoria, Australia
NA
Latitude -38.833 Longitude 143.666
unknown
1000.0

The Scientific name indicated above consists of the Genus, Species and the Authority who first
described the species (here Victorian Botanist Ferdinand von Mueller). Collection consists of the
person who made the collection, the date of the collection and the type of the collection.
Explain the following terms and, in each case, give one example to show how it could be applied to
the above data record:
i)
Granularity
ii)
Dublin Core
iii)
Data quality
[3x2 = 6 marks]

Page 9 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 10 of 40

Ql(a) continued:

Page 11 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 12 of 40

(b)

Data may exist in several forms:


(i) Explain the difference between raw and classified data,
(ii) List at least one advantage and disadvantage of raw and classified forms of data, and
(iii) Give an example to illustrate the use of classification.
[4 marks]

Page 13 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 14 of 40

Question 2 Entity Relationship Modelling

(20 marks)

The local under-sixteen football league needs a database to help track teams, children that sign up to
play in the league, the parents ofthese children and the coaches for each team.
The league wishes to record the details for each parent of a particular player (the parents last name,
first name, phone contact number and address).
For each player the system needs to record the player's last name, first name, blood type and their date
of birth. Any allergies that the player has also need to be recorded. A player may only play in one team
with this league.
Each team is given a unique id, the system needs to record this id, the teams name and the city their
home ground is located in (a city may have several under-sixteen teams based in it). A teams colours
are also to be recorded, teams may choose to use a single or multiple team colours. A team may have
several coaches- one of the coaches is designated as the head coach. A coach is only permitted to
coach one team in the under-sixteen league. All communications from the league to the team are via
the head coach. To be registered to play in this league a team must have a head coach and at least one
player. The database needs to track a coach's first and last name, phone and address contact details and
the team that they are coaching.
Create a relational Logical Model to represent the data requirements described above for this undersixteen league. Your model must

Include all necessary attributes, and


Name all relationships.

[20 marks]

Page 15 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 16 of 40

Under-Sixteen Football League - Logical Model Diagram

Page 17 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 18 of 40

(10 marks)

Question 3 Logical Model and the SQL Create Table Statement

(a) Students enrol in/complete units. A conceptual ER model of the scenario is shown below:

STUDENT
student id [PK]
student_name
student_address
student phone

UNIT
enrols/completes
unit code [PK]
- - - - - - - ~ unit_name
unit points

In addition to the data above, the model should also allow the recording of a student's year and
semester of enrolment, a final unit result as a percentage result and a final unit grade. If a student fails
a unit (grade N) the structure should maintain this fail grade and associated mark in the system and
allow the student to repeat the unit. The grade must be one ofN, P, C, D, HD. The percentage result
must be between 0 and 100 (inclusive).
Convert the conceptual ERD above into a logical model, including the extra items are to be recorded.
[5 marks]

Page 19 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 20 of 40

(b)

Using the logical model you designed for part (a), write the SQL statements needed to create
the table that contains the attributes to store the students unit result/s. Your schema
should include a primary key definition, as well as appropriate referential integrity references
and appropriate column check/s and make use of named constraints.
[5 marks]

Page 21 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 22 of 40

(10 marks)

Question 4 Normalisation

Monash University owns several performance halls that are used by organizations within and outside
Monash University. The following table shows the booking information for several performances
across different venues in Monash University. Multiple performances can be organized at the same
time across multiple venues.

Start
Time
8PM

Date

Venue

Venue
Location
Clayton

12-Jan-20 12

8PM

12-Jan-2012

Robert
Blackwood Hall
K3.24

2PM

14-Jan-2012

8PM

8PM

Event Type
Music concert

Caulfield

Comedy

Event
Description
Melbourne
Symphony
Adam Hill

Robert
Blackwood Hall

Clayton

Musical

Cats

14-Jan-2012

Alexander
Theatre

Clayton

Comedy

Dave
Hughes

16-Jan-2012

Robert
Blackwood Hall

Clayton

Music concert

Hoodoo
Guru

Organiser
MSO
Melbourne
Comedy
Festival
Monash
Student
Association
Melbourne
Comedy
Festival
Mushroom
Promoter

Organiser's
contact
(03)
99021212
(03)
99031456
(03)
99012233
(03)
99031456
(02)
90021002

a) Draw a dependency diagram for this table.


b) Convert the table shown above to Third Normal Form (3NF), showing each stage ofthe
process. Clearly state any assumptions that you make. Use only attributes in the table. Do not
add any new one$.
[3 + 7 = 10 marks]

Page 23 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 24 of 40

(a) Dependency Diagram

Page 25 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 26 of 40

(b) Normalisation

UNF

Primary Key

lNF

2NF

3NF

[4 + 6 = 10 marks]
Page 27 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 28 of 40

Question 5 SQL

(30 marks)

Appendix A shows the logical model for a PAYROLL database. Also provided is the Oracle schema
file for creating the database structure. Using SQL, write commands to achieve the following
results on the PAYROLL database:
a) Display all the names of MANAGERs in the company.

b) Display the employees' name and monthly salary for SALESREP who have not
earned any commission yet.

c) Display the employee name, job, department name, location and monthly salary of
employees that work in Dallas. The result should be ordered by job.

d) Display the name and job of employees who do not work in TRAINING or SALES
department.

Page 29 of40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 30 of 40

e) Display the employees who were born in the first half of the 60s. Display the output in
birth date order.

f)

Display the name and location of all departments, and the name of their employees.
Display the output in employee name order within department name order.

g) Display employee name and the amount of the annual salary for the highest paid
employee in the company.

h) Display the names of employees who earn the same amount of monthly salary as
'MILLER' but not having the same job as MILLER.

i)

For each department list the department number and name, the number of employees,
the minimum and maximum monthly salary, the total monthly salary and the average
salary paid to their employees. Name the columns: NbrOfEmployees, MinSalary,
MaxSalary, Total Salary, A vgSalary.

Page 31 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 32 of 40

j)

List the department names that have average monthly salary of its employees higher
than the average monthly salary in the company.

k) The manager for SALES department "BLAKE" has left the company. "MARTIN" has
been assigned as the new manager. In the new position MARTIN should earn the
same monthly salary as BLAKE's. BLAKE job is set to NULL. Performs necessary
updates to employee and department tables to reflect the changes.

[1 + 2 + 2 + 2 + 2 + 3 + 3 + 3 + 3 + 4 + 5 = 30 marks]

Page 33 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 34 of 40

Question 6 Transaction Management

(10 marks)

a) The four ACID properties required of a transaction are: Atomicity, Consistency, Isolation and
Durability -explain the meaning of each of these properties.
[4 marks]

b) Explain the following statement: "a transaction is a logical unit of work". Use an example to
illustrate you explanation.
[2 marks]

Page 35 of 40

This page may be used for any rough work.


Material written on this page will not be marked unless there is a clear indication that written
material on this page should be included in the answer.

Page 36 of 40

c) Suppose your database system has failed. Describe the database recovery process and the use
of deferred-write and write-through techniques to achieve recovery
[4 marks]

[2+4+4= !Omarks]

END OF EXAMINATION QUESTIONS


APPENDIX A FOLLOWS
Page 37 of 40

Appendix A:

deptno

~lJ\1ER

i ?i(]

(!2.0'

- -staffed~
--

deotrJa"le VARCNAR\10)

--,

COURSE

I
I
I
I
I
I

deot:oca: o'l VARCriARlSJ


e<11pno NUMfi!. C(4,0) [ F< j

~ ~<]

sa. grade NU\ER. 02,0' : ?'<]

crscode. VARCi-IAR(E)

sa

O'M'. \0~1dtC:.6,2)

sa
sa

~poec "U'vlER 06,21


DO"lc;S NUMi:Jl.!C/6,2)

ccsdesc VARC:-lAR 30)


crscategory CNARI3)
crsdc,'at.on \UMt.R.Ci2,0l

PvF';.OvU.
_ _ _ _ _ _ _q_;:'-'--=-=---=--------.

empno '~PJ\1ER,C(4,0J [ K 1

manages

empname. VARCHA'l/8)

emp<'1:t. VARC-IAR(5)
e,-,ojob VARC!AR(Sl

~~~e!0..:.c:,

empbdare DA i
empmsa' ':UMERIC(6,2J
e'11pcomm "oUME::I. ((6,3)

I
I
I
I
I
I

I
I

empno NU\1RC(4,0; ( :>~i(]


h stbegndate. DATE : "K]
h:stbeg:nyear NUMER:C(4,0)
-,:stenddate DATE:

_ _ offe's_ _ _ ---$: offbegndate. DAT ; "K I


uscode VARCNAR(6) [ <>Ci(]

de;WIO '<U0,.1ER:CI2,0) ;

ngrno.

'<UM~R:C(4.0l

off:oca::on VARC4AR(8J
empno \UMR.C(4,0) \ ;K I

~K.]

: "K]

has

nas

co'np'.etes

offbegnda:e DATE :

P~K.)

us code. VARCHAR!6) : ?'-K]


e'npno ':U\1R C(4,0) : "F<]

regeva .;at;on. 'ljUMfJl.'Cf 1,0)

f).s:msa: !I<UMC.R.Cf6,2)
-, stcomments VARC>iAR(60l
dept,lo. NUMERlC(2,0) [ FK]

Create Table
sal grade
sal lower
sal upper
salbonus

'SALGRADE'
Salary Grade
Salary lower limit
Salary upper limit
Salary bonus

CREATE TABLE SALGRADE (


salgrade NUMBER(2)
NOT NULL ,
sallower NUMBER(6,2)
NOT NULL ,
salupper NUMBER(6,2)
NOT NULL ,
salbonus NUMBER(6,2)
NOT NULL
CONSTRAINT salgrade_pk PRIMARY KEY (salgrade),
CONSTRAINT salgrade_chkl CHECK (sallower >= 0),
CONSTRAINT salgrade_chk2 CHECK (sallower <= salupper));
Create Table
crscode
crsdesc
crscategory
crsduration

'COURSE'
Course Code
Course Description
Course Category
Course Duration

CREATE TABLE course (


crscode VARCHAR(6)
NOT NULL 1
crsdesc VARCHAR(30)
NOT NULL 1
crscategory CHAR(3)
NOT NULL 1
crsduration NUMBER(2)
NOT NULL
CONSTRAINT course_pk PRIMARY KEY (crscode) 1
CONSTRAINT course chkl CHECK (crscode = upper(crscode)) 1
CONSTRAINT course chk2 CHECK (crscategory in ( 'GEN' 1 'BLD'

'DSG' )));

Page 38 of 40

'DEPARTMENT'
Department Number
Department Name
Location of department
Employee who manages department
(references EMPLOYEE.empno)
FK constraint cannot be added until employee table is created

Create Table
dept no
deptname
deptlocation
empno

CREATE TABLE DEPARTMENT (


deptno NUMBER(2)
NOT NULL ,
deptname VARCHAR(lO)
NOT NULL ,
deptlocation VARCHAR(8)
NOT NULL ,
empno NUMBER(4) ,
CONSTRAINT department_pk PRIMARY KEY (deptno),
CONSTRAINT department_un UNIQUE (deptname),
CONSTRAINT department chkl CHECK (deptname = upper(deptname)),
CONSTRAINT department_chk2 CHECK (deptlocation =
upper(deptlocation)));
Create Table
empno
empname
empinit
empjob
empbdate
empmsal
empcomm
dept no

'EMPLOYEE'
Employee number
Employee name
Employee initials
Employee job
Employee birthdate
Employee monthly salary
Employee commission
Department Number (references
DEPARTMENT.deptno)
mgrno: Employees manager (empno of manager) (references
EMPLOYEE.empno)

CREATE TABLE EMPLOYEE (


empno NUMBER(4)
NOT NULL ,
NOT NULL ,
empname VARCHAR(8)
NOT NULL ,
empinit VARCHAR(S)
empjob VARCHAR(8)
empbdate DATE
NOT NULL ,
NOT NULL ,
empmsal NUMBER(6,2)
empcomm NUMBER(6,2) ,
deptno NUMBER(2) ,
mgrno NUMBER(4) ,
CONSTRAINT employee_pk PRIMARY KEY (empno),
CONSTRAINT employee_fkl FOREIGN KEY (mgrno)
REFERENCES EMPLOYEE (empno),
CONSTRAINT employee_fk2 FOREIGN KEY (deptno)
REFERENCES DEPARTMENT (deptno));
'DEPARTMENT'
: Employee who manages department (references
EMPLOYEE.empno)
Add constraint for Department table now employee exists:
ALTER TABLE DEPARTMENT
ADD (CONSTRAINT department_fk FOREIGN KEY (empno)
REFERENCES employee (empno));
Alter Table
empno

Create Table
dept no
histbegindate
histbeginyear

'HISTORY'
Department Number (references DEPARTMENT.deptno)
Date history record begins
: Year history record begins
Page 39 of 40

histenddate
histmsal
histcomments
empno

Date history record ends


Monthly Salary for this history record
Comments for this history record
Employee number (references EMPLOYEE.empno)

CREATE TABLE HISTORY


empno NUMBER(4)
NOT NULL ,
histbegindate DATE
NOT NULL ,
histbeginyear NUMBER(4)
NOT NULL ,
histenddate DATE
histmsal NUMBER(6,2)
NOT NULL ,
histcomments VARCHAR(60)
deptno NUMBER(2)
NOT NULL
CONSTRAINT history_pk PRIMARY KEY (empno, histbegindate),
CONSTRAINT history_chk CHECK (histbegindate < histenddate),
CONSTRAINT history_fkl FOREIGN KEY (empno)
REFERENCES EMPLOYEE (empno)
ON DELETE CASCADE,
CONSTRAINT history_fk2 FOREIGN KEY (deptno)
REFERENCES DEPARTMENT (deptno));
Create Table
offbegindate
crscode
off location
empno

'OFFERING'
Begin date for offering
Course Code (references COURSE.crscode)
Location for offering
Employee number for employee running offering
(references EMPLOYEE.empno)

CREATE TABLE OFFERING


offbegindate DATE
NOT NULL ,
crscode VARCHAR(6)
NOT NULL ,
offlocation VARCHAR(8) ,
empno NUMBER(4) ,
CONSTRAINT offering_pk PRIMARY KEY (offbegindate, crscode),
CONSTRAINT offering_fkl FOREIGN KEY (crscode)
REFERENCES course(crscode),
CONSTRAINT offering_fk2 FOREIGN KEY (empno)
REFERENCES EMPLOYEE (empno));
Create Table
'REGISTRATION'
offbegindate
Begin date for offering (references
OFFERING.offbegindate)
crscode
Course Code (references OFFERING.crscode)
regevaluation
: Grade for course completed
empno
: Employee number of employee completing course
(references EMPLOYEE.empno)
CREATE TABLE REGISTRATION (
offbegindate DATE
NOT NULL ,
crscode VARCHAR(6)
NOT NULL ,
empno NUMBER(4) NOT NULL,
regevaluation NUMBER(l)
CONSTRAINT registration_pk PRIMARY KEY (offbegindate, crscode,
empno),
CONSTRAINT resgitration_chk CHECK (regevaluation in (1,2,3,4,5)),
CONSTRAINT registration_fkl FOREIGN KEY (empno)
REFERENCES EMPLOYEE (empno),
CONSTRAINT registration_fk2 FOREIGN KEY (offbegindate, crscode)
REFERENCES OFFERING (offbegindate, crscode));
END OF APPENDIX A
END OF EXAMINATION
Page 40 of 40

Das könnte Ihnen auch gefallen