You are on page 1of 8

DATABASE 600 ASSIGNMENT 2

MALAKA MMAPULA CATHRINE 149244 SEMESTER1

Question 1

1.1 The table shown below stores details of students and the overall grade each student obtained in
different modules. The Primary Key is (studentID, ModuleID).

Results

StudentID StudentName ModuleID ModuleName Grade


S001 Smith M01 Java A
S001 Smith M02 Database B
S002 Ford M03 Java B

i. Which Normal Form does the above table violate and why?

- The table violates 2nd Normal Form.


- Reason, because there are two partial dependencies: StudentID→StudentName and
ModuleID→ModuleName.

ii. Give an example of an update anomaly and example of a delete anomaly that may occur if the
table is left un-normalised. Explain the problems that are caused.
- Update anormally: If a module is to be renamed, it is possible to mistype one of its instances,
thus introducing an inconsistency.

Deletion anormaly: If Students are deleted, modules will also be deleted, resulting in a loss of
modules’details.

iii. Show how you would normalize the table.

- Student(StudentID,StudentName)
- Module(ModuleID,ModuleName)
- Results(Students(StudentID*,ModuleID*,Grade)

1.2 An important concept in the theory of rational databases is that of a functional dependency.

i. Explain what is meant by a functional dependency and give an example.


- An attribute B is fuctionally dependent on an attribute A if each value of A is associated with a
value of B.
- For example, StudentID→StudentName
ii. Identify two functional dependencies in the following table (A,B and C are the attributes):

A B C
a1 b1 c1
DATABASE 600 ASSIGNMENT 2
MALAKA MMAPULA CATHRINE 149244 SEMESTER1

a1 b1 c3
a1 b2 c1

Answer: B→A and C→A

1.3 A company uses the table below to record details of staff.Each staff hs up to three qualifications.

StaffID StaffNAme Qualifications


S01 Victor BSc,MSc,PhD
S02 Wiseman Bsc,Msc
S03 Raymond Bsc,PhD

I. Explain why this table is not in “First Normal Form”(1NF)


- The attribute “qualifications” ismulti-valued on the PK, hence the table is not in 1NF.

II. Show how this table can be transformed into 1NF tables. Give two possible solutions.

Solution 1

Students (Staff ID, Staff Name, Qualification1, Qualification2, Qualifications3)

Solution 2

Students (Staff ID, Staff Name)

Question 2

II.1.1 Main entities


- Video
- Member
- Registration
- Branch
- Staff

Relationships

-Member has Agreement

-VideoForRent IsPartOfRentalAgreement

-Members Agrees for a Registration


DATABASE 600 ASSIGNMENT 2
MALAKA MMAPULA CATHRINE 149244 SEMESTER1

-Branch Has Staff

-Staff has (Manager) Manages Branch

-A Branch has VideoFor Rent

-A Branch Accepts Registration (of Members)

-Video Has VideoForRent copies

2.1.2

Attributes
Branch Branch Number(Primary Key),Address,Telephone Number
Video CatalogNumber (Primary Key),VideoNumber, Title,Category,Daily
Rental, Cost,Status, Actor, Names, Director
Video Rented Video Number(Primary Key)
Member Member Number(Primary Key), First Name, Last Name, Address,
Registration Date
Staff Staff number(Primary Key), Name, Position, Salary
Rental Agreement Rental Number(Primary Key)

2.1.3. An attribute represents a property of an entity or a relationship type; it can have different types as
shown

Simple: position or salary attributes of a table staff (they have atomic values)

Composite: address attribute composed of street, city, and postcode attributes

Single-valued: branch Number attribute of a table Branch

Multi-Valued: Telephone Number, attribute of Branch

Derived: duration of a rental, whose value is calculated from two other attributes representing the Start
Date Rent Start and the finish date Rent Finish, both present in the table schema.

Question 3

3.1 Create an ERD for each of the following descriptions.

3.3.1
DATABASE 600 ASSIGNMENT 2
MALAKA MMAPULA CATHRINE 149244 SEMESTER1
DATABASE 600 ASSIGNMENT 2
MALAKA MMAPULA CATHRINE 149244 SEMESTER1
DATABASE 600 ASSIGNMENT 2
MALAKA MMAPULA CATHRINE 149244 SEMESTER1

Question 4
DATABASE 600 ASSIGNMENT 2
MALAKA MMAPULA CATHRINE 149244 SEMESTER1
DATABASE 600 ASSIGNMENT 2
MALAKA MMAPULA CATHRINE 149244 SEMESTER1

References
Connolly, C. E. (1996). Database Systems: A Practical Approach to Design, Implementation, and ... New
york: pearson.

You might also like