CS 377 - Database Systems
Function Dependency & Decomposition Homework

Due: See class webpage

1. (Question 14.26 in text book)

Conside the relation

```   R = (A, B, C, D, E, F, G, H, I, J)
```
and the following set of functional dependencies on R:
```   F = { A, B -> C
A -> D, E
B -> F
F -> G, H
D -> I, J
}
```

• What is the key(s) in R
• Decompose R losslessly into BCNF

2. (Question 14.27 in text book)

Conside the relation

```   R = (A, B, C, D, E, F, G, H, I, J)
```
and the following set of functional dependencies on R:
```   F = { A, B -> C
B, D -> E, F
A, D -> G, H
A -> I
H -> J
}
```

• What are the key(s) in R
• Decompose R losslessly into BCNF

3. (Question 14.28 in text book)

Consider the following relation:

```    Tuple#       A         B          C
----------------------------------------
#1         10        b1         c1
#2         10        b2         c2
#3         11        b4         c1
#4         12        b3         c4
#5         13        b1         c1
#6         14        b3         c4
```
• Given the above database content, which of the following functional dependencies may hold in the above relation ? If the functional dependency cannot hold, explain why by specifying the tuples that cause the violation.
```   1. A -> B
2. B -> C
3. C -> B
4. B -> A
5. C -> A
```
• Does the above relation have a potential candidate key ? If it does, what is it ? If it does not, why not ?

4. (Adpated from Question 14.29 in text book)

Consider a relation:

```   R = (A, B, C, D, E)
```
with the following functional dependencies:
```   A, B -> C
C, D -> E
D, E -> B
```
• Compute the closure AB+
• Compute the closure CD+
• Compute the closure DE+

5. (Adpated from Question 14.29 in text book)

Consider a relation:

```   R = (A, B, C, D, E)
```
with the following functional dependencies:
```   A, B -> C
C, D -> E
D, E -> B
```
• Find all the keys in relation R