# Trivial and Non Trivial Functional Dependency examples

## Trivial and Non Trivial Functional Dependency examples –

#### Trivial Functional Dependency –

Some functional dependencies are said to be trivial because they are satisfied by all relations. Functional dependency of the form A–>B is trivial if  . or
A trivial Functional Dependency is the one where RHS is a subset of LHS.

```Example, A-->A is satisfied  by all relations involving attribute A.
SSN-->SSN
PNUMBER-->PNUMBER
SSN PNUMBER -->PNUMBER
SSN PNUMBER --> SSN PNUMBER```

#### Non Trivial Functional Dependency –

Non Trivial Functional Dependency can be categorized into –

• Complete Non Trivial Functional Dependency
• Semi Non Trivial Functional Dependency

Complete Non Trivial Functional Dependency – A Functional Dependency is completely non trivial if none of the RHS attributes are part of the LHS attributes.

```Example, SSN --> Ename,
PNUMBER --> PNAME
PNUMBER--> BDATE    X```

Semi Non Trivial Functional Dependencies – A Functional Dependency is semi non trivial if atleast one of the RHS attributes are not part of the LHS attributes.

{TRIVIAL + NONTRIVIAL}

`Question 1 :`
 A B C 1 1 1 1 2 1 2 1 2 2 2 3
`Identify Non Trivial Functional Dependency ?`
`Solution :`
 S.NO Dependencies Non Trivial FD ? 1 A→B × 2 A→C × 3 A→BC × 4 B→A × 5 B→C × 6 B→AC × 7 C→A √ 8 C→B × 9 C→AB × 10 AB→C √ 11 BC→A √ 12 AC→B ×
```A→B is not a non trivial FD because, for 2, it has two outputs. i.e 2→2 and 2→3.
for AB→C, 11→1, 12→1, 21→2, 22→3, so Non trivial.```
```Question 2:
R(A B C D)
AB {Candidate Key}
A→C
B→D .
Where is the redundancy exist ?```
`Solution: (A C) and (B D) is suffering from redundancy.`
```Question 3:
Consider a relation with schema R(A,B,C,D) and FDs {AB -> C, C -> D, D -> A}.
a. What are some of the nontrivial FDs that can be inferred from the given FDs?```
```Some examples:

C -> ACD
AB -> ABCD
AC -> ACD
BC -> ABCD
BD -> ABCD
CD -> ACD
ABC -> ABCD
ABD -> ABCD
BCD -> ABCD```

### Incoming search terms:

• difference between trivial and non trivial dependencies
• trivial functional dependency
• functional dependencies in dbms
• trivial and non trivial dependencies
• trivial and non trivial functional dependency in dbms
• Trivial dependency
• non trivial functional dependency
• trivial and non trivial dependencies in dbms
• trivial and non trivial dependency
• trivial and non trivial functional dependency in dbms ppt