Functional dependency and normalization
Asked Answered
A

6

18

I am trying to find a great resource to study for functional dependency and normalization.

Anyone have any idea where should I look to? I am having difficulty differentiating whether a FD is in 1NF, 2NF or 3NF?

I've been reading Wikipedia and used Google search to find good research, but can't find any that explains it in simple terms.

Maybe you all can share on how you learned FD's and normalization during your life as well.

Aristarchus answered 16/11, 2010 at 21:57 Comment(0)
M
37

A functional dependency defines a functional relationship between attributes. For example: PersonId functionally determines BirthDate (normally written as PersonId -> BirthDate). Another way of saying this is: There is exactly one Birth Date for any given instance of a person. Note that the converse may or may not be true. Many people may have been born on the same day. Given a BirthDate we may find many PersonId sharing that date.

Sets of functional dependencies may be used to synthesize relations (tables). The definition of the first 3 normal forms, including Boyce Codd Normal Form (BCNF) is stated in terms of how a given set of relations represent functional dependencies. Fourth and fifth normal forms involve Multi-Valued dependencies (another kettle of fish).

Here are a few free resources about Functional Dependencies, Normalization and database design. Be prepared to exercise your brain and math skills when studying this material.

The following are "slide shows" from various academic sites...

The following are academic papers. Heavier reading but well worth the effort.

If you are seriously interested in this subject I suggest you put out the cash for a good book on the subject of Relational Database Design. For example: An Introduction to Database Systems by C.J. Date

Meshuga answered 18/11, 2010 at 17:19 Comment(1)
4NF involves multi-valued dependencies (MVDs) & 5NF involves join dependencies (JDs). But a binary JD corresponds to a pair of MVDs (which come in pairs anyway). So "4th & 5th NFs involve" JDs (not MVDs).Amman
G
9

A functional dependency is a constraint between columns of your table. For example in the table person:

SSN         | Name         | Date of birth | Address     | Phone number 
------------------------------------------------------------------------
123-98-1234 | Cindy Cry    | 15-05-1983    | Los Angeles | 123-456-7891
121-45-6145 | John O'Neill | 30-01-1980    | Paris       | 568-974-2562
658-78-2369 | John Lannoy  | 30-01-1980    | Dallas      | 963-258-7413

Here, the value in the column SSN (Social Security Number) determines the values in columns name, date of birth, address and phone number. This means that if we had two rows with the same value in the SSN column, then values in columns name, date of birth, address and phone number would be equal. A person with SSN 123-98-1234 is always called Cindy Cry, is born on 15-05-1983, and so on. A situation like this is called functional dependency.

The notion of functional dependencies is used to define second, and third normal form, and the Boyce-Codd normal form (BCNF).

To read more about functional dependencies and normalization you can go to then well-known academic books like Introduction to Databases by C.J. Date, or any of the books by the H. Garcia-Molina, J.Ullman, J.Widom trio.

If you want a less formal approach, we're starting a series of posts on data normalization on our company blog.

Goodwin answered 7/3, 2014 at 11:6 Comment(1)
You mean, a constraint between column sets, or between a column set & a column. (Whatever that "between" is supposed to mean.) However: A FD is denoted by giving 2 column sets or a column set & a column, but it's not a constraint "between" them, it is a constraint on the entire table (value or variable) also involving them.Amman
C
5

What is Functional Dependency?

Functional Dependencies are fundamental to the process of Normalization Functional Dependency describes the relationship between attributes(columns) in a table. In other words, a dependency FD: X → Y means that the values of Y are determined by the values of X. Two tuples sharing the same values of X will necessarily have the same values of Y. enter image description here

What is Database Normalization?

Database Normalization is a step wise formal process that allows us to decompose Database Tables in such a way that both Data Redundancy and Update Anomalies(see above for more info on update anomalies) are minimized.

enter image description here Courtesy

Canal answered 27/7, 2015 at 1:24 Comment(1)
The NFs are stronger & stronger conditions. But we don't normalize to a given NF via normalizing through lower NFs, we use algorithms for the target NF. This doesn't disagree, but the text and/or 2nd diagram might be taken that way, because the diagram is given right after talking about normalization as a process.Amman
S
4

A functional dependency isn't in any normal form. Normal Form is a property of a relation that satisfies some given set of FDs.

Don't rely on Wikipedia or Google. There is too much misinformation and rubbish from online sources. Try:

Introduction to Database Systems by Chris Date

Practical Issues in Database Management by Fabian Pascal

Solo answered 17/11, 2010 at 0:23 Comment(0)
P
4

We can understand functional dependency in a way that assume we have two attribute and one attribute in totally dependent on the other is called functional dependency.

Say take a real life example. We know that everybody has a social security number against the name of the person . Say Frank is a person and we want to know the social security number of this person but database will be unable to help out with this information because there may be many persons named frank but we can determine name of person against social security number so name of the person is totally functional dependent on Social security number.

Petrina answered 21/6, 2012 at 6:29 Comment(0)
C
0

Functional Dependency

Functional dependency can be defined as relationship that exits between attributes in relation. Functional dependencies are used to create relation in Boyce Codd Normal Form abbreviated as BCNF. If C and D are the attributes of relation R and attribute C functionally determines attributes D then the functional dependency between both attribute can be expressed as C->D.

Example : Below the person schema

person(national_id, name, address);

Here national_id functionally determines the person_name. So functional dependency is national_id -> name;

Functional dependency is important in relational database design for the purpose of eliminating redundancy.

Callipygian answered 24/10, 2017 at 19:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.