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

Consider a relation R (A, B, C, D, E, F, G, H), where each attribute is atomic, and following functional dependencies exist.

CH → G

A → BC

B → CFH

E → A

F → EG

The relation R is ______.

The correct answer is

in 1NF but not in 2NF

Database Normalization Analysis

Let's analyze the given relation R(A, B, C, D, E, F, G, H) and its functional dependencies to determine its normal form.

The functional dependencies (FDs) are:

  • CH → GA
  • A → BC
  • B → CF
  • HE → A
  • F → EG

Checking for 1NF (First Normal Form)

The question states that each attribute in relation R is atomic. This means that each attribute holds a single, indivisible value for each row. This is the definition of First Normal Form (1NF).

Therefore, the relation R is in 1NF.

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 the primary key. To check this, we first need to find the candidate key(s).

Finding the Candidate Key

A candidate key is a minimal set of attributes that can uniquely identify every tuple (row) in the relation. We can find candidate keys by checking attribute closures.

Attributes that do not appear on the right side of any functional dependency are likely part of the key:

  • D (not on RHS)
  • H (not on RHS)
  • E (not on RHS)

Let's find the closure of {D, H, E}:

$\{D, H, E\}^{+}$

  • Start with $\{D, H, E\}$.
  • From HE → A, we add A. Set is now $\{D, H, E, A\}$.
  • From A → BC, we add B, C. Set is now $\{D, H, E, A, B, C\}$.
  • From B → CF, we add F. Set is now $\{D, H, E, A, B, C, F\}$.
  • From F → EG, we add G. Set is now $\{D, H, E, A, B, C, F, G\}$.
  • From CH → GA, we have C and H. This FD adds G and A, which are already in the set.

The closure $\{D, H, E\}^{+}$ includes all attributes {A, B, C, D, E, F, G, H}. Since {D, H, E} can determine all other attributes, it is a candidate key. We should check if it's minimal. Removing D, H, or E would break the connection to all attributes. For example, without H or E, the FD HE → A cannot be used to get A.

Thus, {D, H, E} is the only candidate key for relation R.

Identifying Prime and Non-Prime Attributes

  • Prime attributes: Attributes that are part of any candidate key. In this case, the prime attributes are {D, H, E}.
  • Non-prime attributes: Attributes that are not part of any candidate key. In this case, the non-prime attributes are {A, B, C, F, G}.

Checking for Partial Dependencies

A partial dependency exists if a non-prime attribute is functionally dependent on a proper subset of the candidate key. The candidate key is {D, H, E}. Proper subsets are {D}, {H}, {E}, {D, H}, {D, E}, {H, E}.

Let's examine the given functional dependencies:

  • CH → GA: The determinant {C, H} is not a subset of the key {D, H, E}. This is not a partial dependency on the key {D, H, E}. (Note: This is a dependency involving C and H, which are part of other dependencies deriving from the key path).
  • A → BC: The determinant {A} is not a subset of the key {D, H, E}. This is not a partial dependency on the key {D, H, E}.
  • B → CF: The determinant {B} is not a subset of the key {D, H, E}. This is not a partial dependency on the key {D, H, E}.
  • HE → A: The determinant {H, E} is a proper subset of the candidate key {D, H, E}. The attribute A is a non-prime attribute. Therefore, HE → A is a partial dependency.
  • F → EG: The determinant {F} is not a subset of the key {D, H, E}. This is not a partial dependency on the key {D, H, E}.

Since there is at least one partial dependency (HE → A, where A is non-prime and {H, E} is a proper subset of the key {D, H, E}), the relation R is not in 2NF.

Conclusion on Normal Form

The relation R is in 1NF because all attributes are atomic, as stated. However, it is not in 2NF because there are partial dependencies of non-prime attributes on the candidate key (e.g., HE → A).

Since the relation is not in 2NF, it cannot be in 3NF or BCNF, as these are successively stricter normal forms that build upon 2NF.

Normal Form Evaluation
Normal Form Condition Relation R Status Reason
1NF Attributes are atomic Yes Given in the question
2NF 1NF + No partial dependencies No Partial dependency exists (e.g., HE → A)
3NF 2NF + No transitive dependencies No Not in 2NF
BCNF Every determinant is a candidate key No Not in 2NF

Based on the analysis, the relation R is in 1NF but not in 2NF.

Revision Table: Database Normal Forms

Summary of Normal Forms
Normal Form Requirement
1NF All attribute values are atomic (single-valued). No repeating groups.
2NF Is in 1NF + Every non-prime attribute is fully functionally dependent on the primary key. (No partial dependencies).
3NF Is in 2NF + No non-prime attribute is transitively dependent on the primary key. (No transitive dependencies).
BCNF Is in 3NF + Every determinant is a candidate key. (A stronger version of 3NF).

Additional Information: Understanding Functional Dependencies and Keys

Understanding functional dependencies and keys is crucial for database normalization.

  • Functional Dependency (FD): An FD X → Y means that the values of attributes in set X uniquely determine the values of attributes in set Y. If you know X, you know Y.
  • Determinant: In an FD X → Y, X is the determinant.
  • Candidate Key: A set of attributes K is a candidate key for a relation R if:
    1. K functionally determines all other attributes in R (K → R).
    2. K is minimal; no proper subset of K can functionally determine all other attributes in R.
  • Primary Key: One of the candidate keys chosen by the database designer to uniquely identify tuples.
  • 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 non-prime attribute is dependent on a proper subset of the candidate key. This violates 2NF.
  • Transitive Dependency: A non-prime attribute is dependent on another non-prime attribute, which in turn is dependent on the candidate key (e.g., Key → A and A → B, where A and B are non-prime). This violates 3NF.

Normalization is the process of organizing columns and tables in a relational database to reduce data redundancy and improve data integrity. It involves decomposing relations into smaller, well-structured relations that satisfy higher normal forms.

Was this answer helpful?

Important Questions from Normal Form - Teaching

  1. Consider a schema R(A, B, C, D) and following functional dependencies.

    A → B

    B → C

    C → D

    D → B

    Then decomposition of R into R 1(A, B), R 2(B, C) and R 3(B, D) is _______

  2. If every non-key attribute is functionally dependent on the primary key, then the relation is in _______.

  3. For a database relation R(a, b, c, d) where the domains of a, b, c, and d include only atomic values, and only the following functional dependencies and those that can be inferred from them hold:

    a → c

    b → d

    The relation is in.
  4. Match List I with List II:

    List IList II
    (A)BCNF(I)It removes multivalued dependency
    (B)3 NF(II)It is not always dependency preserving
    (C)2 NF(III)It removes transitive dependency
    (D)4 NF(IV)It removes partial functional dependency

    Choose the correct answer from the options given below:

  5. In relational database, if a relation R is in BCNF, then which of the following is true about relation R?

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