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

Data Management: Functional Dependencies

The document provides instructions for a data management task that involves identifying functional dependencies and normalizing a relational database. Students are asked to analyze a sample table to determine potential functional dependencies between attributes and identify a candidate primary key. They should document their findings in a table and report whether a single attribute or composite key is needed. The task aims to help students learn how to identify issues with database schemas and resolve them through normalization.
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

Data Management: Functional Dependencies

The document provides instructions for a data management task that involves identifying functional dependencies and normalizing a relational database. Students are asked to analyze a sample table to determine potential functional dependencies between attributes and identify a candidate primary key. They should document their findings in a table and report whether a single attribute or composite key is needed. The task aims to help students learn how to identify issues with database schemas and resolve them through normalization.
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

Faculty of Science, Engineering and Technology

Fundamentals of Data Management


Credit Tasks 4.2.1: Functional Dependencies and Normalisation
Overview
In this tutorial, you’ll practise identifying functional dependencies and ensuring a
relational database is in third normal form.

Purpose
Learn to identify problems with database schemas and how to solve them using
normalisation.
Task
Solve the functional dependency and relational design problems outlined below.
Time
This task should be completed in your fourth lab class and submitted for feedback in the
fourth lab.
Resources
• Elmasri & Navathe, Fundamentals of Database Systems, Chapter 15
• Connolly & Begg, Database Systems, Chapter 14
• Online resources, e.g.
o [Link]
o [Link]
• You can use a specialised tool or simply use tables in your lab report.
Feedback
Discuss your solutions with the tutorial instructor.
Next
Get started on week5.

Credit Tasks 4.2.1 — Submission Details and Assessment Criteria


Document your solutions to the tasks in document using a word processor or other
suitable software. Upload a pdf to Doubtfire. The tutors will discuss them with you in the
lab.
Subtask 4.2.1
Suppose all information you have to determine functional dependencies is a table of
data. Depending on unique mappings available a column or a set of columns may qualify
as foreign key. Note that given we don’t know the actual purpose of the table, any new
row may contradict our findings.
Identify the possible functional dependencies in a table that has the following entries:
A B C D
a1 b1 c1 d3
a1 b2 c3 d2
a2 b2 c3 d4
a3 b3 c5 d4

A, B, C and D are the attribute names. Decide which attributes could possibly be
dependent on another attribute or pair of attributes. The way to decide is by exclusion; if
a value of A is in the same row with a two different values of C, C cannot be functionally
dependent on A (but the reverse may be the case).
For example, both a1 and a2 are in the same row with a value of b2. So based on A, we
can’t be sure what the value of B should be.
This is the same question as asking what is a potential primary key for this table.
Present your findings in the following table (you can copy it into your report):
Dependency Possible (Yes/No) Why/why not?
A -> B No the same A value have different B values

A -> C No the same A value has different C values

A -> D No the same A value has different D values

B -> A No the same B value has the same A values

B -> C Yes every B value has a unique C value

B -> D No the same B value has different D values

C -> A No the same C value has different A values

C -> B Yes every C value has a unique B value

C -> D No the same C value has different D values


{A, B} -> C Yes every combination of A and B has different
C value

{A, B} -> D Yes every combination of A and B has


different D value

{B, C} -> A No a combination of B and C has 2 different


A values

{B, C} -> D No a combination of B and C has 2 different D


values

{C, D} -> A Yes every combination of C and D has


different A value

{C, D} -> B Yes every combination of C and D has


different B value

{A, C} -> B Yes every combination of A and C has


different B value

{A, C} -> D Yes every combination of A and C has


different D value

(Don’t worry about the rest of the possible combinations.)


What do you conclude? Do we need a composite key or does one attribute suffice as a
key?
Document your findings and upload.
Each primary key need to have a unique non-primary key. One attribute is not sufficient enough
to be a primary key. We need to find a composite primary key.
From the table above, the combination of {A, D} and {B, D} were not tested. From these 2
combination, we get the following dependencies:
{A, D} -> B
{A, D} -> C
{B, D} -> A
{B, D} -> C
These dependencies are all possible as every combination has a unique dependent value.

From here we can conclude that any of the 2 combination except B and C can create a primary
key.

Common questions

Powered by AI

To identify functional dependencies within a dataset, start by analyzing rows to determine which columns consistently determine the values of others across all entries. Identify primary keys by examining combinations of attributes that uniquely identify rows without repetitions. Use exclusion methods to systematically rule out attributes that do not meet the criteria. Document which attributes are dependent on others, providing foundational understanding for applying normalization principles .

Functional dependencies directly influence the selection of primary and candidate keys by indicating which attributes can determine others in the dataset. Identifying these dependencies helps database designers ascertain which columns or combinations thereof can be used as primary keys. They ensure that the chosen keys reflect dependencies accurately, supporting integrity constraints and optimizing database operations for queries and updates .

To determine if an attribute is functionally dependent on another attribute or a pair, you analyze data patterns in each row of the table. For instance, if an attribute 'A' can appear with multiple and differing values of 'B' in various rows, then 'B' is not functionally dependent on 'A'. This method is used by systematically excluding possibilities until potential dependencies are confirmed. This decision by exclusion helps identify prospective primary keys, which need a set of columns that uniquely determine all other columns .

The objective of functional dependencies in database normalization is to identify and express constraints between different attributes so that database anomalies can be correctly handled. This approach facilitates the organization and structuring of database systems, ensuring data integrity and reducing redundancy. Correct identification of these functional dependencies is key to effectively transforming a database schema into third normal form, ultimately leading to a more optimal design .

If a table requires a composite key for uniqueness, it indicates complex data relationships where no single attribute is sufficient to distinguish rows. This demands deeper analysis to ensure that all possible combinations of columns contributing to uniqueness are identified and managed correctly. This reinforces the importance of understanding data dependencies within the table structure to maintain integrity and efficient data retrieval .

A table achieves third normal form (3NF) when it satisfies several criteria: it must be in second normal form, meaning all non-key attributes are fully functionally dependent on the primary key, and there must be no transitive dependencies—where a non-key attribute depends on another non-key attribute. This eliminates data redundancy and dependency anomalies, ensuring a more consistent and efficient database design .

Identifying a composite key is important in situations where no single attribute uniquely identifies a row in a table. A composite key, which consists of multiple attributes, ensures the uniqueness of each row by combining information from two or more columns. This is necessary when dealing with complex datasets that don't have a single attribute capable of acting as a primary key, thus maintaining data integrity and consistency across relational databases .

A composite primary key is preferable when no single attribute can uniquely identify all records in a table. This is common in entities that naturally have composite identifiers, such as an employee's schedule described by a combination of 'Employee ID' and 'Date'. Using a composite key can provide greater flexibility and accuracy in representing such data, improving relational integrity and supporting complex queries where multiple attributes jointly define uniqueness .

Documenting and uploading the solutions to functional dependency tasks is necessary as it facilitates tutor evaluation and feedback, which are crucial for learning progress. This practice allows students to articulate their reasoning and understanding, contributing to better comprehension and retention of complex database concepts. Furthermore, it supports educational assessments by providing a basis for discussion and further instruction during lab sessions .

The absence of clear functional dependencies can significantly complicate a database's design, leading to challenges in identifying candidate keys and constructing a robust schema. Without clear dependencies, normalization becomes difficult, potentially resulting in tables that exhibit data anomalies such as redundancy, inconsistency, and insertion, deletion, or update anomalies. Such issues can compromise data integrity and retrieval efficiency, necessitating careful schema analysis and design .

You might also like