dbmsmicroproject2
dbmsmicroproject2
dbmsmicroproject2
Data within the most common types of databases in operation today is typically modeled in rows
and columns in a series of tables to make processing and data querying efficient. The data can
then be easily accessed, managed, modified, updated, controlled, and organized. Most databases
use structured query language (SQL) for writing and querying data.
NORMALISATION:
DATABASE NORMALIZATION:
Database normalization is the process of organizing data into tables in such a way that the results
of using the database are always unambiguous and as intended. Such normalization is intrinsic to
relational database theory. It may have the effect of duplicating data within the database and
often results in the creation of additional tables.
The concept of database normalization is generally traced back to E.F. Codd, an IBM researcher
who, in 1970, published a paper describing the relational database model. What Codd described
as "a normal form for database relations" was an essential element of the relational technique.
Such data normalization found a ready audience in the 1970s and 1980s -- a time when disk
drives were quite expensive and a highly efficient means for data storage was very necessary.
Since that time, other techniques, including denormalization, have also found favor.
NEED OF NORAMLIZATION:
6.Supporting Relationships:
Normalization enables the creation of relationships between tables, which is fundamental
for maintaining referential integrity. This supports complex queries and ensures that data is
logically connected.
8.Facilitating Indexing:
Normalized databases can be more easily indexed, leading to improved search performance.
Indexing is crucial for speeding up data retrieval operations.
TYPES OF NORAMLIZATION:
1)First Normal Form:
First normal form (1NF) is a property of a relation in a relational database. A relation is in first
normal form if and only if no attribute domain has relations as elements.[1] Or more informally,
that no table column can have tables as values. Database normalization is the process of
representing a database in terms of relations in standard normal forms, where first normal is a
minimal requirement. SQL-92 does not support creating or using table-valued columns, which
means that using only the "traditional relational database features" (excluding extensions even if
they were later standardized) most relational databases will be in first normal form by necessity.
Database systems which do not require first normal form are often called NoSQL systems.
Newer SQL standards like SQL:1999 have started to allow so called non-atomic types, which
include composite types.
To achieve 1NF, each column in a table must have a distinct name, and the order of
the columns should not affect the data retrieval process. This ensures that the column are
identifiable and can be referenced independently, contributing to the simplicity and
consistency of the database structure. One of the primary goals of 1NF is to eliminate to
use of complex data types, such as arrays or nested tables, within the individual cells.
Each cell should contain atomic data, meaning that it should represents single, indivisible
value. This restriction prevents the need for complex parsing and manipulation of data
making it easier to query and maintain.
Table 1.1 does not have any atomic values in ‘details’ column .Hence, it is called un-normalized
table. Inserting, updating and deletion would be a problem in such table. Hence ,it has to be
normalized. For the table 1.1 to be in the first form ,each row should have automic values.Hence,
let us reconstruct the data in the table. A ’Sr.No’ cloumn is included in the table to uniquely
identify each row.
Sr.No D_id D_name Gender Age D_regdate City D_bloodgrp
2)Second Normal Form:
Second Normal Form (2NF) is based on the concept of full functional dependency. Second Normal Form
applies to relations with composite keys, that is, relations with a primary key composed of two or more
attributes. A relation with a single-attribute primary key is automatically in at least 2NF. A relation that is
not in 2NF may suffer from the update anomalies. To be in second normal form, a relation must be in first
normal form and relation must not contain any partial dependency. A relation is in 2NF if it has No
Partial Dependency, i.e., no non-prime attribute (attributes which are not part of any candidate key) is
dependent on any proper subset of any candidate key of the table. In other words,
A relation that is in First Normal Form and every non-primary-key attribute is fully functionally
dependent on the primary key, then the relation is in Second Normal Form (2NF).
An entity is in the third normal form if it is in the second normal form and all of its attributes are not
transitively dependent on the primary key. Transitive dependence means that descriptor key attributes
depend not only on the whole primary key, but also on other descriptor key attributes that, in turn, depend
on the primary key. In SQL terms, the third normal form means that no column within a table is
dependent on a descriptor column that, in turn, depends on the primary key.
To convert to third normal form, remove attributes that depend on other descriptor key attributes.
Third normal form (3NF) is a crucial concept in the field of database normalization, a
process designed to organize relational tables efficiently. It builds upon the foundation laid
by the first and second normal forms (1NF and 2NF) and addresses a specific types of data
redundancy issues.
3NF builds on the principles of 1NF and 3NF and addresses the issues of transitive
dependency. A table is in 3NF if it is in 2NF and no transitive dependencies exist-that is,
no non-prime attribute is dependent on another non-prime attribute.
In conclusion, Third Normal Form (3NF) is a critical step in the normalization
process, aiming to eliminate transitive dependencies and enhance the efficiency and
integrity of a relational database. It involves careful analysis, decomposition and
restructuring of tables to ensure that data is stored in a logically organized and non-
redundant manner. While achieving 3NF brings significant benefits, it's essential to strike
a balance between normalization and practical consideration to maintain optimal database
performance.