Lecture 21: - Activity Used: Problem Solving
Lecture 21: - Activity Used: Problem Solving
• For example: Consider a table with two columns Student_id and Student_Name.
• {Student_Id, Student_Name} -> Student_Id is a trivial functional dependency as Student_Id is a
subset of {Student_Id, Student_Name}. That makes sense because if we know the values of
Student_Id and Student_Name then the value of Student_Id can be uniquely determined.
• Also, Student_Id -> Student_Id & Student_Name -> Student_Name are trivial dependencies too.
Non-Trivial
• For example:
An employee table with three attributes: emp_id, emp_name, emp_address.
The following functional dependencies are non-trivial:
emp_id -> emp_name (emp_name is not a subset of emp_id)
emp_id -> emp_address (emp_address is not a subset of emp_id)
Multivalued dependency
In the above table, we can see Students Amit and Akash have interest in more than one activity.
This is multivalued dependency because CourseDiscipline of a student are independent of
Activities, but are dependent on the student.
Therefore, multivalued dependency −
Person->>Mobile
Person->>Food_like
Transitive dependencies
• A functional dependency is said to be transitive if it is indirectly formed by two functional dependencies.
For e.g.
• X -> Z is a transitive dependency if the following three functional dependencies hold true:
• X->Y
• Y does not ->X
• Y->Z
• Example
• {Book} ->{Author} (if we know the book, we knows the author name)
{Author} does not ->{Book}
{Author} -> {Author_age}
• Therefore as per the rule of transitive dependency:
{Book} -> {Author_age}
should hold, that makes sense because if we know the book name we can know the author’s age.
• Functional dependencies
• Types of FD
• Trivial
• No.trivial
• Multivalued
• Trannsitive depen
Closure of a set of functional dependencies
• Given a set F set of functional dependencies, there are certain other functional
dependencies that are logically implied by F .
• The set of all functional dependencies logically implied by F is the closure of
F.
• We denote the closure of F by F +.
• W+= wzyx
Activity: Problem Solving
• Consider a relation R with five attributes V, W, X, Y, and Z. The
following functional dependencies hold:
VY→ W, WX → Z, and ZY → V.
Which of the following is a candidate key for R?
(A) VXZ
(B) VXY
(C) VWXY
(D) VWXYZ
• Lecture 22