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

Databases 1 Programming Assignment Unit 3

Databases 1

Uploaded by

hamedhussam25
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Databases 1 Programming Assignment Unit 3

Databases 1

Uploaded by

hamedhussam25
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Assignment Information

:Given the following unnormalized relation representing a library database


Books (Book_ID, Title, Author, Genre, Publisher, Publication_Year, ISBN, Price
a) Define normalization in the context of database management systems (DBMS).
.Explain why normalization is essential for database design
Normalization
in the context of Database Management Systems (DBMS) is a process used to "
organize a database into tables and columns. The main goal is to reduce data
redundancy and improve data integrity. This process involves dividing large tables
into smaller, related tables and defining relationships between them. The various
normal forms (1NF, 2NF, 3NF, BCNF, etc.) provide guidelines to achieve a well-
.structured database" (GeeksforGeeks, 2015)
Importance of Normalization
1. Eliminates Redundancy: Reduces duplicate data, saving storage space and
improving data integrity.
2. Improves Data Integrity: Ensures data dependencies make sense and are stored
logically, reducing the risk of anomalies.
3. Facilitates Maintenance: Easier to update and maintain the database with changes
affecting minimal records.
4. Improves Query Performance: Well-structured data can lead to more efficient query
processing.
(Rehan, 2023).
b) Normalize this relation into First Normal Form (1NF), Second Normal Form
(2NF), Third Normal Form (3NF) and Boyce-Codd Normal Form (BCNF).
1NF (First Normal Form definition All attribute values are atomic (indivisible).
Analysis: The given relation is already in 1NF as all attributes contain atomic values.

Books Table:

Book ID Title Author Genre Publisher


Publication_Yea ISBN Price
r
1 Title Author1 Genre1 Publisher1 2010 1234567891014 24.99
1
2 Title Author2 Genre2 Publisher2 2011 1234567891011 29.99
2

2NF (Second Normal Form)


Definition: In 1NF, and every non-key attribute is fully functionally dependent on the
primary key.
Book ID Title Author Genre Publisher
Publication_Yea ISBN Price
r
1 Title Author1 Genre1 Publisher1 2010 1234567891014 24.99
1
2 Title Author2 Genre2 Publisher2 2011 1234567891011 29.99
2

3NF (Third Normal Form)


Books Table:
Book_ID ISBN
1 1234567891014
2 1234567891011

ISBN_Details Table:
ISBN Title Author Genre Publisher Publication_Year Price

1234567891014 Title Author1 Genre1 Publisher 2010 24.99


1 1
1234567891011 Title Author2 Genre2 Publisher 2011 29.99
2 2

BCNF (Boyce-Codd Normal Form)


In the 3NF decomposition, if there are no remaining anomalies and each non-trivial
functional dependency has a superkey on the left-hand side, it satisfies BCNF. Here,
the tables created in 3NF already satisfy BCNF.
Books Table:
Book_ID ISBN
1 1234567891014
2 1234567891011

ISBN_Details Table:
ISBN Title Author Genre Publisher Publication_Year Price

1234567891014 Title Author1 Genre1 Publisher 2010 24.99


1 1
1234567891011 Title Author2 Genre2 Publisher 2011 29.99
2 2

Meet all 3NF requirements.


For every functional dependency X→Y, X should be a superkey.

c) For each normalization step (1NF, 2NF, 3NF, BCNF) performed in Part (b),
explain the specific functional dependencies present in the original relation and
how they are addressed through normalization.
1NF:
Ensured atomicity of values.
Addressed by ensuring no repeating groups.

2NF:

Addressed partial dependencies.

The original table had no partial dependencies.

3NF:

Addressed transitive dependencies.


Decomposed into:

Books Table:
Book_ID ISBN
1 1234567891014
2 1234567891011

ISBN_Details Table:
ISBN Title Author Genre Publisher Publication_Year Price

1234567891014 Title Author1 Genre1 Publisher 2010 24.99


1 1
1234567891011 Title Author2 Genre2 Publisher 2011 29.99
2 2

BCNF:

Ensured every determinant is a superkey.

The tables from 3NF decomposition already satisfied BCNF.

d) Discuss the advantages and potential drawbacks of achieving higher normal


forms (3NF and BCNF) compared to lower normal forms (1NF and 2NF) in
terms of database design, querying efficiency, and data integrity.
Advantages

Improved Data Integrity: Higher normal forms like 3NF and BCNF ensure that data
anomalies are minimized.
Reduced Redundancy: Helps eliminate duplicate data, saving storage and improving
data consistency.

Enhanced Query Performance: Queries can be more efficient as the data is


structured logically.

Drawbacks:

Complexity: Designing a database to meet higher normal forms can be complex and
time-consuming.

Increased Joins: Higher normalization often leads to more tables, which can require
more joins in queries, potentially reducing query performance.
Overhead: Maintaining a highly normalized database can lead to additional overhead
during data updates due to the need for multiple table accesses.
References:

GeeksforGeeks. (2015, July 8). Normal Forms in DBMS - GeeksforGeeks.

GeeksforGeeks. https://www.geeksforgeeks.org/normal-forms-in-dbms/

Rehan, M. (2023, June 22). What is Data Normalization and Why is it Important?

Apimio. https://apimio.com/importance-of-data-normalization/

Watt, A. (2020, October 24). Chapter 12 Normalization. Opentextbc.ca; BCcampus.

https://opentextbc.ca/dbdesign01/chapter/chapter-12-normalization/

You might also like