All Exams Test series for 1 year @ ₹349 only
Question

Direction: Answer question based on the problem statement given below:

An organization needs to maintain database having five attributes A, B, C, D, E. These attributes the functionally dependent on each other for which functionally dependency set F is given as: F : (A → BC, D → E, BC → D, A → D}. Consider a universal relation R(A, B, C, D, E) with functional dependency set F. Also all attributes are simple and take atomic values only.

Assume that given table R is decomposed in two tables

R 1(A, B, C) with functional dependency set f 1= {A → B, A → C} and R 2(A, D, E) with FD set F 2= {A → D, D → E}

Which of the following option is true w.r.t. given decomposition?

The correct answer is

R 1is in 3 NF and R 2is in 2 NF

Understanding Database Decomposition and Normalization

This problem involves analyzing a database relation that has been decomposed into two sub-relations and determining their normalization forms (2NF and 3NF) and checking for the dependency preservation property.

We are given a universal relation R(A, B, C, D, E) with the functional dependency set F: ${A \rightarrow BC, D \rightarrow E, BC \rightarrow D, A \rightarrow D}$. The relation R is decomposed into two tables: R1(A, B, C) with functional dependency set F1 = ${A \rightarrow B, A \rightarrow C}$, and R2(A, D, E) with functional dependency set F2 = ${A \rightarrow D, D \rightarrow E}$. We need to evaluate the given options regarding this decomposition.

Analyzing Relation R1(A, B, C) and its Normal Form

The functional dependencies for R1 are F1 = ${A \rightarrow B, A \rightarrow C}$.

  • Finding the Candidate Key: To find the candidate key, we look for an attribute or set of attributes whose closure contains all attributes in R1 (A, B, C).
    • ${A}^{+} = A$. Using $A \rightarrow B$, ${A}^{+} = AB$. Using $A \rightarrow C$, ${A}^{+} = ABC$.

Since ${A}^{+}$ contains all attributes (A, B, C), A is a candidate key for R1. As A is the only attribute on the left side of any dependency in F1 that can determine all others, A is the only candidate key.

  • Prime and Non-Prime Attributes:
    • Prime attributes are attributes that are part of any candidate key. In R1, A is the only prime attribute.
    • Non-prime attributes are attributes that are not part of any candidate key. In R1, B and C are non-prime attributes.

Now, let's check the normalization forms for R1:

  • Second Normal Form (2NF): A relation is in 2NF if it is in 1NF (which is given as all attributes are simple and atomic) and every non-prime attribute is fully functionally dependent on every candidate key.
    • Candidate key is A.
    • Non-prime attributes are B and C.
    • Is B fully dependent on A? Yes, $A \rightarrow B$ is given in F1. Since A is a simple key, any dependency on A is a full dependency.
    • Is C fully dependent on A? Yes, $A \rightarrow C$ is given in F1. Since A is a simple key, any dependency on A is a full dependency.

R1 is in 2NF.

  • Third Normal Form (3NF): A relation is in 3NF if it is in 2NF and there are no transitive dependencies of non-prime attributes on the candidate key. A transitive dependency exists if Key → X and X → Y, where Y is a non-prime attribute and X is not part of the key.
    • Candidate key is A.
    • Non-prime attributes are B and C.
    • Are there any dependencies like A → X and X → Y where Y is non-prime and X is not A? The dependencies are $A \rightarrow B$ and $A \rightarrow C$. Neither B nor C functionally determines any other attribute in R1 according to F1. There is no path A → (non-key) → (non-prime).

Therefore, R1 is in 3NF.

Analyzing Relation R2(A, D, E) and its Normal Form

The functional dependencies for R2 are F2 = ${A \rightarrow D, D \rightarrow E}$.

  • Finding the Candidate Key:
    • ${A}^{+} = A$. Using $A \rightarrow D$, ${A}^{+} = AD$. Using $D \rightarrow E$, ${A}^{+} = ADE$.

Since ${A}^{+}$ contains all attributes (A, D, E), A is a candidate key for R2. A is the only candidate key.

  • Prime and Non-Prime Attributes:
    • Prime attributes: A.
    • Non-prime attributes: D, E.

Now, let's check the normalization forms for R2:

  • Second Normal Form (2NF): R2 is in 1NF. Is every non-prime attribute fully dependent on every candidate key?
    • Candidate key is A.
    • Non-prime attributes are D and E.
    • Is D fully dependent on A? Yes, $A \rightarrow D$ is given in F2. A is a simple key, so it's a full dependency.
    • Is E fully dependent on A? Yes, from $A \rightarrow D$ and $D \rightarrow E$, we can derive $A \rightarrow E$ by transitivity. Since A is a simple key, this is a full dependency.

R2 is in 2NF.

  • Third Normal Form (3NF): R2 is in 2NF. Are there any transitive dependencies of non-prime attributes on the candidate key?
    • Candidate key is A.
    • Non-prime attributes are D and E.
    • Consider the dependency $A \rightarrow D$ and $D \rightarrow E$. Here, A is the key, E is a non-prime attribute, and D is a non-key attribute that is not part of the key. This forms a transitive dependency: $A \rightarrow D \rightarrow E$.

Because of the transitive dependency $A \rightarrow E$ via D, R2 is not in 3NF.

Analyzing Dependency Preservation Property

Dependency preservation means that the union of the functional dependencies in the decomposed relations is equivalent to the original set of functional dependencies (or their closure). That is, $F_{1} \cup F_{2}$ should be equivalent to F.

Original FDs: F = ${A \rightarrow BC, D \rightarrow E, BC \rightarrow D, A \rightarrow D}$.

Decomposed FDs: F1 = ${A \rightarrow B, A \rightarrow C}$, F2 = ${A \rightarrow D, D \rightarrow E}$.

Let's check if we can derive all original FDs from F1 $\cup$ F2 = ${A \rightarrow B, A \rightarrow C, A \rightarrow D, D \rightarrow E}$.

  • $A \rightarrow BC$: From $A \rightarrow B$ and $A \rightarrow C$ in F1, we can derive $A \rightarrow BC$. This is preserved.
  • $D \rightarrow E$: This is explicitly in F2. This is preserved.
  • $A \rightarrow D$: This is explicitly in F2. This is preserved.
  • $BC \rightarrow D$: Can we derive $BC \rightarrow D$ from ${A \rightarrow B, A \rightarrow C, A \rightarrow D, D \rightarrow E}$? Let's find the closure of BC: ${BC}^{+}$.
    • ${BC}^{+} = BC$. There are no dependencies starting with B or C alone or BC in F1 $\cup$ F2 that would add A, D, or E. Therefore, ${BC}^{+} = BC$.

Since ${BC}^{+}$ does not contain D, the dependency $BC \rightarrow D$ from the original set F is not preserved in the decomposition.

Evaluating the Options

Based on our analysis:

  • R1 is in 3NF.
  • R2 is in 2NF but not in 3NF.
  • The decomposition is not dependency preserving.

Let's look at the given options:

Option Statement Evaluation
1 Dependency preservation property is followed False, because $BC \rightarrow D$ is not preserved.
2 R1 and R2 are both in 2 NF True. R1 is in 3NF (hence 2NF) and R2 is in 2NF.
3 R2 is in 2 NF and R3 is in 3 NF R3 is not defined in the problem. Assuming it refers to R1, the statement R2 is in 2NF and R1 is in 3NF is True.
4 R1 is in 3 NF and R2 is in 2 NF True. Our analysis shows R1 is in 3NF and R2 is in 2NF.

Options 2, 3 (assuming R3 is R1), and 4 all seem to contain true statements based on our analysis. However, multiple-choice questions typically have only one best or intended answer. The provided correct answer text is "R 1is in 3 NF and R 2is in 2 NF", which exactly matches Option 4. While R2 being in 2NF and R1 being in 3NF is also true (Option 3 with assumption), Option 4 specifically combines R1 being in 3NF and R2 being in 2NF, which is a precise statement of their highest achieved normal forms among 2NF and 3NF.

Conclusion on Normal Forms

Based on the detailed analysis of R1 and R2 regarding 2NF and 3NF:

  • R1(A, B, C) is in 3NF because it is in 2NF and has no transitive dependencies of non-prime attributes on the candidate key A.
  • R2(A, D, E) is in 2NF because it is in 1NF and all non-prime attributes (D, E) are fully dependent on the candidate key A. However, it is NOT in 3NF due to the transitive dependency $A \rightarrow E$ via D.

Therefore, the statement "R1 is in 3 NF and R2 is in 2 NF" is true.

Revision Table: Database Normalization Concepts

Normal Form Requirements Explanation
1NF (First Normal Form) Attributes must be atomic. No repeating groups. Each cell in the table contains a single value. All attributes are simple and take atomic values.
2NF (Second Normal Form) Must be in 1NF. No partial dependencies of non-prime attributes on any candidate key. If a relation has a composite candidate key, non-prime attributes must depend on the entire key, not just a part of it. For relations with simple keys, 1NF implies 2NF.
3NF (Third Normal Form) Must be in 2NF. No transitive dependencies of non-prime attributes on any candidate key. A non-prime attribute should not be dependent on another non-prime attribute. Key → Non-Key → Non-Prime is not allowed.

Additional Information: Dependency Preservation and Lossless Join Decomposition

When decomposing a relation, two desirable properties are Dependency Preservation and Lossless Join.

  • Dependency Preservation: A decomposition is dependency preserving if the union of the functional dependencies of the decomposed relations is equivalent to the original set of functional dependencies. This ensures that we can check the original dependencies by only checking the dependencies in the decomposed relations, without needing to join the tables. As shown in our analysis, this decomposition is not dependency preserving because $BC \rightarrow D$ is lost.
  • Lossless Join Decomposition: A decomposition of relation R into R1, R2, ..., Rn is lossless if joining R1, R2, ..., Rn recovers the original relation R without generating spurious tuples. For a decomposition into two relations R1 and R2, it is lossless if (R1 $\cap$ R2) → R1 or (R1 $\cap$ R2) → R2 holds based on the functional dependencies.
    • In our case, R1 = (A, B, C) and R2 = (A, D, E). The intersection is R1 $\cap$ R2 = ${A}$.
    • We need to check if ${A}^{+} \rightarrow ABC$ (i.e., A → R1) or ${A}^{+} \rightarrow ADE$ (i.e., A → R2) is derivable from the original FDs F.
    • From F, ${A}^{+} = A$. Using $A \rightarrow BC$, ${A}^{+} = ABC$. Using $A \rightarrow D$, ${A}^{+} = ABCD$. Using $D \rightarrow E$, ${A}^{+} = ABCDE$.
    • Since ${A}^{+}$ contains both R1 (ABC) and R2 (ADE) attributes, ${A} \rightarrow R_{1}$ and ${A} \rightarrow R_{2}$ are derivable. Thus, the decomposition is lossless.

This decomposition (R1, R2) is lossless join but not dependency preserving.

Was this answer helpful?

Important Questions from Functional Dependency - Teaching

  1. Let R (ABCDEFGH) be a relation schema and F be the set of dependencies F = {A → B, ABCD → E, EF → G, EF → H and ACDF →EG}. The minimal cover of a set of functional dependencies is

  2. In a database, a rule is defined as (P1 and P2) or P3? R1 (0.8) and R2 (0.3), where P1, P2, P3 are premises and R1. R2 are conclusions of rules with certainty factors (CF) 0.8 and 0.3 respectively. If any running program has produced P1, P2, P3 with CF as 0.5, 0.8. 0.2 respectively, find the CF of results on the basis of premises.

  3. Minimal cover F’ of functional dependency set F is

  4. Identify the redundant functional dependency in F

  5. Identify primary key of table R with functional dependency set F

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App