Skip to document

Worksheet Chapter 7 - Memo

Worksheets for practise with memos
Course

Introduction to Databases and Databases Management Systems:Part 1 (CSIQ2634)

37 Documents
Students shared 37 documents in this course
Academic year: 2021/2022
Uploaded by:
Anonymous Student
This document has been uploaded by a student, just like you, who decided to remain anonymous.
University of the Free State

Comments

Please sign in or register to post comments.

Preview text

UNIVERSITY OF THE FREE STATE

Department of Computer Science

and Informatics

CSIS

Worksheet (Chapter 7)

Question 1 1NF Step 1: Eliminate repeating groups: Supplier Supplier City Part Part Quantity Part Colour Sup1 Cape Town ABCB123 12 Grey Sup1 Cape Town JKU87 10 Yellow Sup1 Cape Town FDGE65 5 Blue Sup2 Johannesburg JKU87 3 Yellow Sup3 Cape Town ABCB123 4 Grey Sup3 Cape Town GHSD789 2 Grey

Step 2: Identify the primary key Supplier, Part Step 3: Identify all dependencies

Supplier SupplierCity Part PartQuantity PartColour

Table is now in 1NF 2NF Step 1: Write each key component on a separate line Supplier Part Supplier, Part

Step 2: Assign Corresponding Dependent Attributes Supplier(Supplier, SupplierCity) Part(Part, PartColour) SupplierPart(Supplier, Part, PartQuantity)

Table is in second normal form because it is in 1NF and includes no partial dependencies. 3NF Step 1: Identify Each New Determinant There are no determinants Step 2: Identify the Dependent Attributes There are no determinants with dependent attributes Step 3: Remove the Dependent Attributes from Transitive Dependencies There are no transitive dependencies Table is in 3NF because it is in 2NF and has no transitive dependencies

Refined ERD: Supplier PK SupplierName

SupplierPart PK SupplierName SupplierPartQuantity

PK Part_Id

Part PK Part_Id ColourId

Cit yId 1.. 1 suppli es > 1. .* 1. .*

1.. 1

supplied by >

C it yId

C it y PK Cit yId Cit yNa me

Colour PK ColourId ColourName

  1. .* 1.. 1

si tu ate d in >

  1. .* 1.. 1has >

Question 2 1NF Step 1: Eliminate repeating groups There are no repeating groups Step 2: Identify the primary key Emp_id, emp_dept Step 3: Assign dependencies Draw dependency diagrams, for simplicity I will just show the relational schemas with dependencies Emp_id, emp_dep ->emp_name, emp_city, dept_name, job_code, job_desc Partial dependencies: Emp_id->emp_name, emp_city Emp_dept->dept_name Transitive dependencies Job_code->job_desc Table is in 1NF 2NF Step 1: Write down each key component on a separate line Emp_id Emp_dept Emp_id, emp_dept Step 2: Assign Corresponding Dependent Attributes EMPLOYEE(Emp_id, emp_name, emp_city) DEPARTMENT(Emp_dept, dept_name) EMPLOYEEDEPARTMENT(Emp_id, emp_dept, job_code, job_desc)

Table is in 2NF because it is in 1NF and there are no partial dependencies 3NF

Step 1: Identify Each New Determinant Job_code Step 2: Identify the Dependent Attributes Job_code->job_desc Step 3: Remove the Dependent Attributes from Transitive Dependencies EMPLOYEE(Emp_id, emp_name, emp_city) DEPARTMENT(Emp_dept, dept_name) EMPLOYEEDEPARTMENT(Emp_id, emp_dept, job_code) JOB(job_code, job_desc) Table is in 3NF because it is in 2NF and has no transitive dependencies Question 3 Follow the normalisations steps and see if you end up with the following schemas: TEACHER(TEACHERID, TEACHERNAME, TEACHERSURNAME) SUBJECT(SUBJECTCODE, SUBJECTNAME, TEACHERID, VENUECODE) VENUE(VENUECODE, VENUENAME)

Was this document helpful?

Worksheet Chapter 7 - Memo

Course: Introduction to Databases and Databases Management Systems:Part 1 (CSIQ2634)

37 Documents
Students shared 37 documents in this course
Was this document helpful?
1 | Page
UNIVERSITY OF THE FREE STATE
Department of Computer Science
and Informatics
CSIS2634
Worksheet (Chapter 7)
Question 1
1NF
Step 1: Eliminate repeating groups:
Supplier
Supplier City
Part
Part Quantity
Part Colour
Sup1
Cape Town
ABCB123
12
Grey
Sup1
Cape Town
JKU87
10
Yellow
Sup1
Cape Town
FDGE65
5
Blue
Sup2
Johannesburg
JKU87
3
Yellow
Sup3
Cape Town
ABCB123
4
Grey
Sup3
Cape Town
GHSD789
2
Grey
Step 2: Identify the primary key
Supplier, Part
Step 3: Identify all dependencies
Supplier
SupplierCity
Part
PartQuantity
PartColour
Table is now in 1NF
2NF
Step 1: Write each key component on a separate line
Supplier
Part
Supplier, Part