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

Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values.

F = {CH → G, A → BC, B → CFH, E → A, F → EG} is a set of functional dependencies (FDs) so that F+ is exactly the set of FDs that hold for R.

The relation R is

The correct answer is

in 1NF, but not in 2NF.

Understanding Database Normalization and Normal Forms

The question asks about the normal form of relation R given its attributes and a set of functional dependencies. To determine the normal form, we need to check if the relation satisfies the conditions for 1NF, 2NF, 3NF, and BCNF in sequence.

Step 1: Checking for 1NF (First Normal Form)

A relation is in 1NF if all attribute values are atomic and there are no repeating groups. The question explicitly states, "Fields of R contain only atomic values." This means each attribute contains a single value, not a set of values or a nested structure. Therefore, the relation R satisfies the conditions for First Normal Form.

Step 2: Checking for 2NF (Second Normal Form)

A relation is in 2NF if it is in 1NF and every non-prime attribute is fully functionally dependent on every candidate key. To check this, we first need to identify the candidate key(s) of the relation R.

Finding Candidate Keys for Relation R

A candidate key is a minimal set of attributes that can uniquely identify every tuple in the relation. We can find candidate keys by examining the given functional dependencies (FDs):

  • CH → G
  • A → BC
  • B → CFH
  • E → A
  • F → EG

The attributes are {A, B, C, D, E, F, G, H}.

We look for attributes that do not appear on the right-hand side of any functional dependency. The attribute D does not appear on the right side of any FD. This means D must be part of any candidate key.

Let's try adding other attributes to D to see if we can determine all attributes {A, B, C, D, E, F, G, H}.

  • Consider {D, E}: {D, E}$^+$ → {D, E}. E → A, so {D, E}$^+$ → {D, E, A}. A → BC, so {D, E}$^+$ → {D, E, A, B, C}. B → CFH, so {D, E}$^+$ → {D, E, A, B, C, F, H}. F → EG, so {D, E}$^+$ → {D, E, A, B, C, F, H, G}. Thus, {D, E}$^+$ = {A, B, C, D, E, F, G, H}. {D, E} is a candidate key.
  • Consider {D, F}: {D, F}$^+$ → {D, F}. F → EG, so {D, F}$^+$ → {D, F, E, G}. E → A, so {D, F}$^+$ → {D, F, E, G, A}. A → BC, so {D, F}$^+$ → {D, F, E, G, A, B, C}. B → CFH, so {D, F}$^+$ → {D, F, E, G, A, B, C, H}. Thus, {D, F}$^+$ = {A, B, C, D, E, F, G, H}. {D, F} is a candidate key.
  • Consider {D, B}: {D, B}$^+$ → {D, B}. B → CFH, so {D, B}$^+$ → {D, B, C, F, H}. F → EG, so {D, B}$^+$ → {D, B, C, F, H, E, G}. E → A, so {D, B}$^+$ → {D, B, C, F, H, E, G, A}. Thus, {D, B}$^+$ = {A, B, C, D, E, F, G, H}. {D, B} is a candidate key.

The candidate keys for relation R are {D, E}, {D, F}, and {D, B}.

Identifying Prime and Non-Prime Attributes

Prime attributes are those that are part of any candidate key. From the candidate keys identified ({D, E}, {D, F}, {D, B}), the prime attributes are {D, E, F, B}.

Non-prime attributes are those that are not part of any candidate key. The non-prime attributes are {A, C, G, H}.

Checking for Partial Dependencies

A partial dependency exists if a non-prime attribute is functionally dependent on a proper subset of any candidate key. Let's examine the FDs involving non-prime attributes {A, C, G, H}:

  • E → A: A is a non-prime attribute. E is a proper subset of the candidate key {D, E}. Thus, E → A is a partial dependency.
  • A → BC: B is prime, C is non-prime. A is not a subset of any candidate key.
  • B → CFH: C is non-prime, F is prime, H is non-prime. B is a proper subset of the candidate key {D, B}. Thus, B → C and B → H are partial dependencies.
  • CH → G: C and H are non-prime. {C, H} is not a subset of any candidate key.
  • F → EG: E is prime, G is non-prime. F is a proper subset of the candidate key {D, F}. Thus, F → G is a partial dependency.

Since there are partial dependencies (E → A, B → C, B → H, F → G) where non-prime attributes are dependent on a proper subset of a candidate key, the relation R is not in Second Normal Form (2NF).

Conclusion

The relation R is in 1NF because it has atomic values. However, it is not in 2NF because there are partial dependencies of non-prime attributes on candidate keys. Therefore, the relation R is in 1NF, but not in 2NF.

Normal Form Condition Check Status Reason
1NF Atomic values, no repeating groups Satisfied Given in the question
2NF In 1NF + No partial dependencies of non-prime attributes on candidate keys Not Satisfied Partial dependencies exist (e.g., E → A, B → C, B → H, F → G)
3NF In 2NF + No transitive dependencies of non-prime attributes on candidate keys Not Applicable Not in 2NF
BCNF Every determinant is a candidate key Not Applicable Not in 2NF

Revision Table: Functional Dependencies and Normalization

Reviewing key concepts related to functional dependencies and normal forms is crucial for understanding database normalization.

  • Functional Dependency ($\text{X} \rightarrow \text{Y}$): If two tuples have the same value for attributes in set X, they must have the same value for attributes in set Y.
  • Candidate Key: A minimal set of attributes that uniquely identifies a tuple.
  • Prime Attribute: An attribute that is part of any candidate key.
  • Non-Prime Attribute: An attribute that is not part of any candidate key.
  • Partial Dependency: A functional dependency $\text{X} \rightarrow \text{Y}$ where Y is a non-prime attribute and X is a proper subset of a candidate key.

Additional Information: Database Normal Forms Explained

Understanding the hierarchy of normal forms helps in designing efficient and consistent databases.

  • 1NF (First Normal Form): Ensures atomicity of attributes and eliminates repeating groups. This is the basic requirement for a relational database.
  • 2NF (Second Normal Form): Builds upon 1NF by removing partial dependencies. This means non-prime attributes must depend on the entire candidate key, not just a part of it.
  • 3NF (Third Normal Form): Builds upon 2NF by removing transitive dependencies. This means non-prime attributes should not depend on other non-prime attributes.
  • BCNF (Boyce-Codd Normal Form): A stricter version of 3NF. In BCNF, for every functional dependency $\text{X} \rightarrow \text{Y}$, X must be a superkey (which means X is a candidate key or contains a candidate key).

Moving to higher normal forms generally reduces data redundancy and anomalies (insertion, deletion, update anomalies) but might increase the number of tables, potentially impacting query performance. The choice of normal form depends on the specific requirements of the database application.

Was this answer helpful?

Important Questions from Functional Dependency

  1. Consider the following database table having A, B, C and D as its four attributes and four possible candidate keys (I, II, III and IV) for this table :
    ABCD
    $a_1$$b_1$$c_1$$d_1$
    $a_2$$b_3$$c_3$$d_1$
    $a_1$$b_2$$c_1$$d_2$

    I : {B} II : {B, C} III : {A, D} IV : {C, D}
    If different symbols stand for different values in the table (e.g., $d_1$ is definitely not equal to $d_2$), then which of the above could not be the candidate key for the database table ?
  2. Let $P, Q, R$ and $S$ be the attributes of a relation in a relational schema. Let $X \rightarrow Y$ indicate functional dependency in the context of a relational database, where $X, Y \subseteq \{P, Q, R, S\}$.
    Which of the following options is/are always true?
  3. In the context of schema normalization in relational DBMS, consider a set F of functional dependencies. The set of all functional dependencies implied by F is called the closure of F. To compute the closure of F, Armstrong's Axioms can be applied. Consider $X$, $Y$, and $Z$ as sets of attributes over a relational schema. The three rules of Armstrong's Axioms are described as follows.

    Reflexivity: If $Y \subseteq X$, then $X \rightarrow Y$
    Augmentation: If $X \rightarrow Y$, then $XZ \rightarrow YZ$ for any $Z$
    Transitivity: If $X \rightarrow Y$ and $Y \rightarrow Z$, then $X \rightarrow Z$

    The additional rule of Union is defined as follows.

    Union: If $X \rightarrow Y$ and $X \rightarrow Z$, then $X \rightarrow YZ$

    It can be proved that the additional rule of Union is also implied by the three rules of Armstrong's Axioms. Listed below are four combinations of these three rules. Which one of these combinations is both necessary and sufficient for the proof ?
  4. Let R = ABCDE is a relational scheme with functional dependency set F = {A → B, B → C, AC → D}. The attribute closures of A and E are

  5. A relation R = {A, B, C, D, E, F,G} is given with following set of functional dependencies :

    F = {AD → E, BE → F, B → C, AF → G}

    Which of the following is a candidate key ?

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