0% found this document useful (0 votes)
53 views3 pages

Database Normalization Tutorial Guide

The document describes a tutorial on relational database design and normalization. It lists the learning outcomes as describing the aims of good relational design through normalization, explaining potential data anomalies, identifying functional dependencies, and normalizing relations. The tutorial addresses normalization and database design. Sample exercises are provided to identify keys and dependencies, determine normal forms, and normalize relations.

Uploaded by

zia ul haq
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views3 pages

Database Normalization Tutorial Guide

The document describes a tutorial on relational database design and normalization. It lists the learning outcomes as describing the aims of good relational design through normalization, explaining potential data anomalies, identifying functional dependencies, and normalizing relations. The tutorial addresses normalization and database design. Sample exercises are provided to identify keys and dependencies, determine normal forms, and normalize relations.

Uploaded by

zia ul haq
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Tutorial 8

Relational Model and Database Normalization

LEARNING OUTCOMES FOR THIS TUTORIAL


After completing this workshop you should be able to:
• Describe the aims of good relational database design through normalisation
• Explain the potential modification anomalies (update, insert and delete) associated with
redundant information in tables
• Identify functional dependencies among attributes
• Give definitions of the following normal forms: 1NF, 2NF, 3NF
• Be able to identify which normal form a given relation is in from examining its functional
dependencies
• Normalise a given relation to a higher normal form

This workshop addresses the following learning outcomes of the unit:

ULO_06: Demonstrate practical knowledge of normalisation and database design

Exercises on Normalization

Given the relation and functional dependencies;

Example: STUDENT (StudentNo, Name, PrimaryMajor, School)

FDs: StudentNo → Name, PrimaryMajor, PrimaryMajor → School

1. Candidate key is StudentNo, as if we know StudentNo we can find all other attributes from it

2. The original relation is in 2NF. There are no partial FDs so it is in 2NF at least. It is not in 3NF as
there is a transitive FD StudentNo → PrimaryMajor → School

3. 3NF relations:

STUDENT (StudentNo, Name, PrimaryMajor)

MAJOR (PrimaryMajor, School)

1
Given the following relation and functional dependencies:

a) Identify the candidate key(s) and partial functional dependencies among attributes (If any)
b) Explain which NF the relation is in.
c) Convert the relation into a relation or set of relations in at least 3NF

Q1. ENROLS (StudentNo, Name, UnitCode, UnitName, Grade)

FDs: StudentNo → Name

UnitCode → UnitName

StudentNo, UnitCode → Grade

Q2. Each loan application is by one customer but each customer may make many applications

ApplicNo Customer Address Date Appr

X97 JoeBlog Perth 2/3

X99 Vicki Sydney 3/3

Y72 JoeBlog Perth 3/3

Converting the table to a relation

Q3: Given the following table:

Part No Description Vendor Address UnitCost

1234 Logic Chip Fast Chips Perth 10.00

Smart Chips Sydney 5.00

5678 Memory chip Fast Chips Perth 3.00

Quality Chips Sydney 2.00

Smart Chips Sydney 5.00

2
a) Convert this table to a single relation (called PART-SUPPLIER) in first normal form. Illustrate the
relation with the same sample data.

b) List the functional dependencies in PART-SUPPLIER and identify the candidate key(s).

c) Convert PART-SUPPLIER to a set of relations in at least third normal form.

Common questions

Powered by AI

Functional dependencies in a relational model are identified by examining the relationships where one attribute uniquely determines another. For instance, if knowing 'StudentNo' allows us to determine 'Name', then 'StudentNo' functionally determines 'Name'. Identifying these dependencies is critical for database normalization, guiding the reduction of redundancy and the design of tables in higher normal forms. Functional dependencies help delineate the necessary decomposition of tables to eliminate partial and transitive dependencies, ensuring each table meets required normalization standards, which enhances data integrity and operational efficiency .

Normalization is essential for efficient data retrieval and maintaining data integrity because it structures databases to minimize redundancy and dependency conflicts. By decomposing relations into tables according to normal forms, normalization streamlines retrieval operations as data are stored logically and consistently, making queries more straightforward and reducing processing time. It ensures that anomalies—such as data duplication and inconsistency during updates—are minimized. For example, without normalization, retrieving 'School' for a 'StudentNo' might involve complex joins on non-normalized tables. In contrast, a 3NF structure allows precise indexing and simpler, more reliable data access patterns .

Modification anomalies occur when redundant information in database tables leads to issues during data updates, inserts, and deletes. These anomalies include update anomalies, where changes in data require multiple updates; insert anomalies, which prevent new data entry due to missing other attribute values; and delete anomalies, which result in unintended data loss when deleting information. When tables are not normalized, redundant data can propagate such issues. The use of normalization techniques in database design aims to alleviate these anomalies by organizing data into related tables with minimal redundancy .

To structure a table in 2NF into 3NF, transitive functional dependencies must be removed. In the STUDENT relation with attributes (StudentNo, Name, PrimaryMajor, School), where 'StudentNo' determines 'Name' and 'PrimaryMajor', and 'PrimaryMajor' transits to determine 'School', the table is in 2NF due to lack of partial dependencies but not 3NF due to the transitive dependency. To convert it to 3NF, split the table into two: one containing (StudentNo, Name, PrimaryMajor) and another containing (PrimaryMajor, School). This removes the transitive dependency between 'PrimaryMajor' and 'School', ensuring each table attribute depends only on the primary key .

Relation normalization significantly impacts database scalability and maintenance by organizing data into structured formats that minimize redundancy and enhance data integrity. This systematic organization facilitates easier data changes and reduces the risk of anomalies, making the system more stable and predictable. By decomposing tables to adhere to higher normal forms, normalization ensures that each aspect of data can be maintained independently, allowing databases to scale when new applications or data sets are incorporated without affecting existing functionalities. With minimal data duplication, normalization supports leaner table architectures, enabling efficient index use and fast access times, which are crucial for scalable and maintainable database systems .

Identifying candidate keys is vital for ensuring data integrity and determining the primary key for uniquely identifying records. A candidate key is the minimal super key that can determine all other attributes in the table. In the ENROLS relation, the candidate key is 'StudentNo, UnitCode' since together they uniquely identify each record, thereby allowing determination of all other attributes, such as 'Name', 'UnitName', and 'Grade'. The candidate key is essential for structuring the relational schema adequately to avoid redundancy and maintain the integrity of the database .

Partial dependencies occur when an attribute depends on only part of a composite key, while transitive dependencies exist when non-key attributes depend on other non-key attributes. In the ENROLS table, partial dependencies do not exist because attributes like 'Name' and 'Grade' depend on individual components of the composite key ('StudentNo', 'UnitCode'), rather than a portion. On the other hand, a transitive dependency is exemplified in the STUDENT table: 'PrimaryMajor' is determined by 'StudentNo' and 'School' depends on 'PrimaryMajor', creating a chain of dependency. Removing transitive dependencies leads to higher normalization levels .

Converting a table to Third Normal Form (3NF) primarily helps reduce the risk of modification anomalies—update, insert, and delete. In a 3NF table, transitive dependencies are removed, so that non-key attributes do not depend on other non-key attributes, reducing redundancy. For example, in the STUDENT table, transitive dependencies are removed by splitting into two tables, which prevents potential anomalies where changing 'PrimaryMajor' might not synchronously update 'School' for a student. 3NF facilitates easier updates and deletions without risking inconsistent data and allows simpler, efficient data insertions, thus streamlining database operations .

Understanding functional and partial dependencies is critical for effective database design as they inform decisions about structuring and normalizing data. Functional dependencies describe the relationship between attributes, guiding the design phase to ensure that data are logically represented without redundancy. Partial dependencies indicate dependencies on part of a composite key, which should be removed to achieve Second Normal Form (2NF). This understanding ensures that the database is designed to eliminate redundancy and prevent modification anomalies. In effective design, recognizing these dependencies allows decomposing tables optimally, maintaining balance between normalization and the complexity of queries required .

A relation is in First Normal Form (1NF) if it has no repeating groups or arrays, each table cell holds only one value, and each record is unique. Using the PART-SUPPLIER example, initially, there may be a scenario where parts and corresponding suppliers are captured in a manner that allows duplicated rows for different suppliers of the same part. To normalize into 1NF, ensure single atomic values in each cell and introduce a primary key such as a combination of 'Part No' and 'Vendor'. This ensures the table structure has unique entries and each data field is indivisible .

You might also like