In: Computer Science
Why normalization and referential integrity are important principles when designing relational databases?
Normalization:
Normalization is the method of organizing info to cut back
redundancy and improve data integrity. social control additionally
simplifies the info style in order that it achieves the best
structure composed of atomic components. By normalizing info, you
prepare the information into tables and columns. You make sure that
every table contains solely connected information. If information
isn't directly connected, you produce a brand new table for that
information.
Benefits of
Normalization:
There square measure several advantages of normalizing a
info.
1) Minimizes information redundancy (duplicate data).
2) Minimizes null values.
3) Results in a additional compact info (due to less information
redundancy/null values).
4) Minimizes/avoids information modification problems.
5) Simplifies queries.
6) The info structure is cleaner and easier to grasp.
7) You can extend the info while not essentially impacting the
prevailing information.
Referential
Integrity:
Referential integrity refers to the accuracy and consistency of
knowledge inside a relationship. In relationships, information is
joined between 2 or more tables. this is often achieved by having
the foreign key reference a primary key value. Because of this,
we'd like to confirm that information on each side of the link stay
intact.
So denotative integrity can prevent users
from:
1) Adding records to a connected table if there's no associated
record within the primary table.
2) Changing values in an exceedingly primary table that lead to
parentless records in an exceedingly connected table.
3) Deleting records from a primary table if there square measure
matching connected records.
Design
Principles for relational Data:
There area unit six main objectives that has to be consummated
effectively by a decent info.
1) Usability
2) Extensibility
3) Data Integrity
4) Performance
5) Availability
6) Security
Principle
1: Each column ought to contain one worth. every
column in your info ought to contain one worth. you must not have
multiple values in an exceedingly single cell.
Principle
2: Every worth in an exceedingly column ought to be
of an equivalent sort. among a column, each worth ought to be of an
equivalent style of data. you must not combine the kind of data
among a column.
Principle
3: Each record ought to be distinctive. every
record in your info ought to be distinctive. you must not have over
one record containing a piece of equivalent information.
Principle
4: Each piece of information ought to solely behold
on in one place. each bit of information in your info ought to
solely behold on in one place. you must not store an equivalent
data in additional than one place.
Principle
5: The order of records in an exceedingly table
shouldn't carry any that means. The order of records shouldn't be
wont to indicate any that means regarding the info. If it's
necessary to point the order, use a column to record it.
Principle
6: Each table ought to have a Primary Key (PK)
that's distinctive for every record. every table in your info ought
to have a singular column as a primary key. this could then be wont
to accurately determine every record, and visit those records from
another table.
Principle
7: The Primary Key (PK) shouldn't carry any that
means, apart from unambiguously distinctive every record. the
primary Key shouldn't carry any that means, apart from
unambiguously distinctive every record.
Principle
8: Each table ought to describe one entity. Each
table within the info ought to describe one logical entity. you
must not combine entities among an equivalent table. each column in
an exceedingly table ought to relate on to that entity.
Thank U:)