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

Which of the following statement(s) is/are correct regarding a relation in second normal form?

I. It is in first normal form

II. Every non-key attribute is fully and functionally independent on the primary key

The correct answer is

Only I

Understanding Second Normal Form (2NF) in Databases

The question asks us to evaluate two statements regarding a relation that is in Second Normal Form (2NF).

Let's analyze each statement based on the definition and rules of database normalization, specifically concerning 2NF.

Statement I: It is in first normal form

Database normalization follows a progressive process. To be in 2NF, a relation must first satisfy all the requirements of First Normal Form (1NF).

  • First Normal Form (1NF): A relation is in 1NF if and only if every attribute contains only atomic (indivisible) values, and there are no repeating groups of columns. Essentially, each cell in the table should contain a single value.
  • Second Normal Form (2NF): A relation is in 2NF if and only if it is in 1NF and every non-key attribute is fully functionally dependent on the primary key.

The definition of 2NF explicitly states that a relation must first be in 1NF. Therefore, if a relation is in Second Normal Form, it necessarily satisfies the conditions of First Normal Form.

Thus, statement I is correct.

Statement II: Every non-key attribute is fully and functionally independent on the primary key

This statement talks about the dependency of non-key attributes on the primary key in a relation in 2NF.

  • Functional Dependency: An attribute or set of attributes A is functionally dependent on an attribute or set of attributes B (written as B → A) if, for any two tuples, whenever the values of B are the same, the values of A must also be the same.
  • Full Functional Dependency: An attribute A is fully functionally dependent on a primary key B if A is functionally dependent on B, but not on any proper subset of B. This is particularly relevant when the primary key is a composite key (made up of multiple attributes).

The rule for Second Normal Form (2NF) is that every non-key attribute must be fully functionally dependent on the entire primary key. This means that the value of each non-key attribute must be determined by the complete primary key, not just a part of it.

Statement II says that non-key attributes are "fully and functionally independent" on the primary key. This is the opposite of the 2NF requirement. 2NF requires dependency, specifically full functional dependency, not independence.

Thus, statement II is incorrect.

Summary of Analysis

  • Statement I: A relation in 2NF is also in 1NF. This is Correct.
  • Statement II: Every non-key attribute is fully and functionally independent on the primary key. This is Incorrect.

Based on the analysis, only statement I is correct.

Revision Table: Database Normal Forms

Normal Form Requirements
1NF (First Normal Form) Attributes have atomic values; no repeating groups.
2NF (Second Normal Form) Must be in 1NF; every non-key attribute is fully functionally dependent on the primary key.
3NF (Third Normal Form) Must be in 2NF; no transitive dependency of non-key attributes on the primary key.
BCNF (Boyce-Codd Normal Form) Stricter than 3NF. For every non-trivial functional dependency X → Y, X must be a superkey.

Additional Information: Functional Dependency in 2NF

Let's consider an example to understand the importance of full functional dependency for 2NF.

Suppose we have a table Order_Details with attributes (OrderID, ProductID, ProductName, OrderQuantity, CustomerName). The primary key is (OrderID, ProductID).

Functional Dependencies:

  • (OrderID, ProductID) → OrderQuantity (The quantity depends on a specific product in a specific order)
  • (OrderID, ProductID) → CustomerName (The customer name depends on the order, which is identified by OrderID, and the product is irrelevant for the customer's name for a given order) - This dependency (OrderID → CustomerName) is a partial dependency on the primary key (OrderID, ProductID).
  • ProductID → ProductName (The product name depends only on the ProductID) - This is also a partial dependency on the primary key.

In this example, Order_Details is in 1NF but not in 2NF because:

  • CustomerName is functionally dependent on OrderID, which is only a part of the primary key (OrderID, ProductID). This is a partial dependency.
  • ProductName is functionally dependent on ProductID, which is only a part of the primary key (OrderID, ProductID). This is another partial dependency.

To bring this table into 2NF, we would decompose it into multiple tables:

  • Order_Info (OrderID, CustomerName): Primary Key (OrderID). CustomerName is fully dependent on OrderID.
  • Product_Info (ProductID, ProductName): Primary Key (ProductID). ProductName is fully dependent on ProductID.
  • Order_Line_Items (OrderID, ProductID, OrderQuantity): Primary Key (OrderID, ProductID). OrderQuantity is fully dependent on the composite key (OrderID, ProductID).

This decomposition eliminates the partial dependencies, ensuring that all non-key attributes in each new table are fully functionally dependent on their respective primary keys, thus achieving 2NF.

The original statement II incorrectly claims independence where dependency is required for 2NF.

Was this answer helpful?

Important Questions from Normal Form

  1. Which of the following normal forms specifically addresses and eliminates partial dependencies?

  2. Consider a relational schema team(name, city, owner), with functional dependencies {name $\to$ city, name $\to$ owner}.

    The relation team is decomposed into two relations, t1(name, city) and t2(name, owner). Which of the following statement(s) is/are TRUE?

  3. In a relational database, which one of the following is CORRECT:
     

  4. Which of the following is false ?

  5. The Relation

    Vendor Order (V_no, V_ord_no, V_name, Qty_sup, unit_price)

    is in 2NF because :

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