Functional Dependency

Before we move on to hard core Conceptual data modelling, we need to first take a moment to look at the concept of Primary Keys or Identifier Keys. We’ll use the Database theory of Functional Dependency to provide some insight into Primary Keys.

What is Functional Dependency ?

Simply stated it’s a relationship that exists when one attribute uniquely determines another attribute.   Differently stated a functional dependency can also be classified as a set of constraints between 2 attributes in a relationship.

These statement are a bit confusing but lets make it real by using a practical example.

We have a Table with employee details

Now you’ve probably seen 100’s of tables just like this one before but what we often don’t think about is that the table actually represents a relationship. Each row in this table describes how each attribute in the table relates to the other attributes in the table.

So we know by looking at this table we got a Guy (male) called Sean and he has a ID Nr of AB1920. But we also have another  Lady (female) called Akhona with an ID JD99210. Each row represents a relationship.

So if we look at the Name Attribute we can’t really use that as a Unique Key, as you can see there are 2 Sean’s in this data table. We can’t use the Gender Attribute as there will be multiple employees being either male or Female, and we can use surname as the surname can also be repeated in the data table.

We can however see that the [ID Nr] is unique. So, we can safely say in the language of Functional dependency.

The [Name] is functionally dependent on the [ID Nr].

In other words : [ID Nr] ==> [Name]

[ID Nr] = Determinant = it is the identification Key  (can be uniquely determined – this can be classified as the Primary Key)

[Name, Surname, Gender] = Dependent (always depends on the Determinant)

So if we had to re-express it in terms of Functional Dependency

Each Attribute Expressed as X,Y,Z & W
  • X ==> Y (X Determines Y – Y is functionally dependent on X)
  • X ==> Z (X Determines Z – Z is functionally dependent on X)
  • X ==> W (X Determines W – W is functionally dependent on X).

So now that we have functional dependency covered in this article we’ll turn our focus on conceptual data modelling.

Author : James Botes

James Botes is a Cape Town Senior Business Analyst (CBAP) with a keen interest in Systems Thinking & Solving Business Problems. Founder and Creator of the site and you tube channel BASensei. Linkedin : https://www.linkedin.com/in/james-botes-73a63b67/

Leave a Reply

Your email address will not be published. Required fields are marked *

four × 4 =