12th Databases
12th Databases
Concepts
Database Designing
Emp-ID Emp-Name
Emp-ID functionally determines Emp-Name
Database Physical and Logical Design
• Physical design refers to the organization of data on the disk.
• Logical Design refer to the design of the tables, their inter-relationship, and key
definition.
• Database Redundancy: Information may be repeated unnecessarily in several
tuples. Unwanted and uncontrolled duplication of data, loss of data integrity and
data consistency.
• Anomalies: Redundancy occur when we try to cram too much into a single
relation are called anomalies.
• Update Anomaly: we may change information in one tuple but leave the same
information unchanged in another.
• Deletion Anomaly: if a set of values become empty, we may lose other
information as a side effect.
Decomposition
Roll-No Roll-No
Stu-Name Stu-Name
Sub-Code
Sub-Name Sub-Code
Marks Sub-name
Marks
• If we are able to successfully reassemble the split tables so that we can recreate
the original data, then the decomposition is desirable and successful.
Data Integration and Data
Redundancy
When all copies of redundant data are not updated consistently, a data integrity problem exists.
Anomalies
• Typically occur in poorly structured files.
• Problems arise when two different kinds of data, like salesperson and
customer data are merged into one file.
• Normalization is the way to avoid Anomalies.
Normalization
Number of Tables
First Normal Form (1NF)
Redundancy
Complexity
• Second Normal Form (2NF)
• Third Normal Form (3NF)
• Boyce-Codd Normal Form (BCNF)
• Fourth Normal Form (4NF)
• Fifth Normal Form (5NF)
• Domain Key Normal Form (DKNF)
First Normalization Form (1NF)
A table is in the first normal form (1NF) if
• It does not contain any repeating columns
• It Contain only atomic value.
1st Normalization Decomposition
After First Normalization
Students Knowledge Area
StuID FirstName LastName StuID FirstName Knowledge
• In simple words, the 3NF requires a table to be in the second normal form.
Additionally, every non-key column in the table must be independent of all
other non-key columns.
3NF
3NF
• A table is in the 3rd NF if it is in the second NF and if all non key columns
in the table depend non-transitively on the entire primary key.
• Another kind of relationship also exist in relational Databases. This type
of relationship is called transitive dependency. It is an indirect
relationship between two columns. Formally defined as:
• There is a functional dependency between two columns B and C, such
that C functionally dependent on B.
• We say that C transitively depends on A.
•A B C