Standardization (Choice of primary keys)
It is the formal process step by step to examine the attributes of an entity, in order to avoid anomalies observed in the addition, deletion and modification of unique sequences.
Objectives
1) Minimization of duplication and inconsistencies;
2) Ease of handling database;
3) Maintainability Information System.
1st Normal Form (1NF)
A relation is in 1NF if only all the basic fields contain only unique values (does not contain repeating groups).
Procedures:
a) Identify the primary key of the entity;
b) Identify the repetitive group and removes it from the body;
c) Create a new entity with the primary key of the entity and the group before repeating.
The primary key of the new entity will be obtained by concatenation of the primary key of the original entity and the repetitive group.
Ex: Request
(Numero_pedido; data_pedido; cod_cliente; customer_name; endereco_cliente; (codigo_produto; numero_produto; quantidade_produto; preco_produto; total_produto) total_pedido)
Request => (numero_pedido; data_pedido; cod_cliente; customer_name; endereco_cliente)
Item_Pedido => (numero_pedido; cod_produto; nome_produto; quantity; preco_produto; total_produto)
Functional Dependency
A given ratio R, the attribute X is functionally dependent R X R attribute is only necessary when two R sequences to combine values of X they also match the value of X.
2nd Normal Form (2NF)
A relation R is in 2NF if and only if it is the first and all nonkey attributes are fully dependent on primary key (dependent on the entire key and not just part of it).
Procedures:
a) Identify the attributes that are not functionally dependent on the entire primary key.
b) Remove the entity identified all these attributes and create a new entity with them.
The primary key of the new entity will be the attribute of which the attributes are removed attributes which are functionally dependent.
Product => (cod_produto, nome_produto, preco_produto)
Transitive Dependency
Let A, B and C three attributes of an entity X. C depending on whether B and B depend on the C is then said to transitively dependent A.
3rd Normal Form (3NF)
A relation R is in 3NF if only you are in 2NF and every nonkey attributes are dependent on the primary key is not transitive (each attribute is functionally dependent only on the primary key attributes of the components or if all its non-key attributes are mutually independent) .
Procedures:
a) Identify all attributes that are functionally dependent on other nonkey attributes;
b) Remove them and create a new entity with the same.
The primary key of the new entity will be the attribute which removed the attributes are functionally dependent.
Customer (cod_cliente; customer_name; endereco_cliente)
Product (cod_produto; nome_produto; preco_produto)
Request (numero_pedido; data_pedido;






























No comments.