Post by rubina9898 on Dec 25, 2023 3:13:22 GMT
It is worth standardizing from the very beginning. For example in a table storing address data separating the city and street fields makes sense in the vast majority of cases. Nevertheless you can find many cases where Donald Knuth's words are confirmed. Premature optimization is the root of all evil. Normal forms in relational databases Database normalization involves reducing the structure of tables in the database to such a form that they meet the assumptions of normal form. The most common and used normal forms are First normal form NF Second normal form.
NF Third normal form NF In addition in the literature on the subject you can also find normal forms such as Boyce Codd Normal Form Fourth normal form NF Fifth normal form NF In the Phone Number List article I will focus on the first three due to the fact that they are common and that their use will bring the most benefits. First normal form To demonstrate the first normal form I will use the example of a table containing items on the menu of a pizzeria. Unnormalized table First normal form says that every value in the database should be atomic in other words indivisible.
The example presented does not meet this rule. First of all each item contains a list of ingredients. Moreover some of the ingredients are repeated in several positions. If you want to modify an ingredient for example replacing cheese with mozzarella cheese you will need to modify all entries in the table. Searching a table with this structure for the ingredients used also leaves much to be desired. In the presented case the solution is to use a many to many relationship and divide the presented table into a table with items a table with ingredients and an intermediary table containing information about what ingredients a given item contains. Thanks to this the component becomes a separate entity in the database it has a primary key which makes it identifiable and unique.
NF Third normal form NF In addition in the literature on the subject you can also find normal forms such as Boyce Codd Normal Form Fourth normal form NF Fifth normal form NF In the Phone Number List article I will focus on the first three due to the fact that they are common and that their use will bring the most benefits. First normal form To demonstrate the first normal form I will use the example of a table containing items on the menu of a pizzeria. Unnormalized table First normal form says that every value in the database should be atomic in other words indivisible.
The example presented does not meet this rule. First of all each item contains a list of ingredients. Moreover some of the ingredients are repeated in several positions. If you want to modify an ingredient for example replacing cheese with mozzarella cheese you will need to modify all entries in the table. Searching a table with this structure for the ingredients used also leaves much to be desired. In the presented case the solution is to use a many to many relationship and divide the presented table into a table with items a table with ingredients and an intermediary table containing information about what ingredients a given item contains. Thanks to this the component becomes a separate entity in the database it has a primary key which makes it identifiable and unique.