0% found this document useful (0 votes)
3 views

Assignment 2

The document outlines the process of normalizing a database table through various normal forms, including First Normal Form (1NF), Second Normal Form (2NF), Third Normal Form (3NF), and Boyce-Codd Normal Form (BCNF). It provides SQL queries and explanations for each normalization step, emphasizing the importance of eliminating repeating groups, partial dependencies, and transitive dependencies. The document also highlights the practical applications of these normalization techniques in improving data structure and query efficiency.

Uploaded by

shanthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Assignment 2

The document outlines the process of normalizing a database table through various normal forms, including First Normal Form (1NF), Second Normal Form (2NF), Third Normal Form (3NF), and Boyce-Codd Normal Form (BCNF). It provides SQL queries and explanations for each normalization step, emphasizing the importance of eliminating repeating groups, partial dependencies, and transitive dependencies. The document also highlights the practical applications of these normalization techniques in improving data structure and query efficiency.

Uploaded by

shanthi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Designing a Table in First Normal Form (1NF)

Write a SQL query to normalize a table into First Normal Form (1NF).

2. Resolving Partial Dependencies for Second Normal Form (2NF)

Write a SQL query to resolve partial dependencies and achieve 2NF.

3. Eliminating Transitive Dependencies for Third Normal Form (3NF)

Write a SQL query to eliminate transitive dependencies and achieve 3NF.

4. Achieving Boyce-Codd Normal Form (BCNF)

Write a SQL query to resolve overlapping candidate keys and achieve BCNF.

Sample Answer for first Normal form :

-- Original table with repeating groups.

CREATE TABLE Orders (

OrderID INT,

CustomerName VARCHAR(100),

ProductNames VARCHAR(MAX) -- Comma-separated list of products.

);

-- Normalize the table into 1NF by splitting repeating groups.

CREATE TABLE Orders_1NF (

OrderID INT,

CustomerName VARCHAR(100),

ProductName VARCHAR(100)

);
Explanation:

 Purpose of the Query :

o The goal is to eliminate repeating groups and ensure atomic values in each
column, achieving 1NF.

 Key Components :

o Orders_1NF: A normalized table where each product is stored in a separate


row.

o Each column contains only one value per row.

 Why use 1NF? :

o 1NF ensures that data is stored in a structured format, making it easier to


query and maintain.

o It eliminates redundancy caused by repeating groups.

 Real-World Application :

o In an e-commerce system, storing each product in a separate row simplifies


order processing.

You might also like