eurocec ebusiness innovations web services





  European Centre of e-Commerce & Publishing


29/12/20

SQL | MySQL Programming | Using MySQL with PHP | Authentication Login System | Content Management System | MySQL 5 Installation |


SQL / Creating the Database Schema


The Second Normal Form - 2NF



To improve the structure of a database table in order to come to the second normal form - 2NF, we must be in the first normal form - 1NF.


In the second normal form procedure we remove all partial dependencies thatexist among the fields of a table.

Thus, a table is in 2NF if all attributes (columns-fields) that are not part of the primary key are fully functionally dependent on the primary key.
We know that the primary key must uniquely identify a single row in a table.
The relationship between the two entities Departments and Dept_Locations is many-to-many since one department can have more than one locations and vice versa in one location more than one departments can exist.



To remove all partial dependencies that there are among the fields in the tables above we create an intermediate table with contents the primary keys of the two other.

Thus, the many-to-many relationship of the two tables is transformed to one-to-many relationships with the new tableto both of them.




In our example after the creation of the intermediate table the contents of the tree tables will be as follows.







Copyright © euRoCec.eu

The content and services of eurocec.eu are offered under the terms of use which the visitors have accepted.


Sectors: Publishing, e-Business Development, Financial and Investment Consulting, Web Services, WebSite Management, WebSite Optimization, Search Engines Optimization, Web Business Plans, Email Marketing.