Normalization
Normalization
• Normalization Process:
- Dependency Diagram:
Before going through the normalization process, we need to draw the dependency diagrams for
our tables, in order to properly identify and evaluate the dependencies for each one.
- Normalization Process :
We can verify that our tables adhere to the various standards for each of the standard
forms as part of the review process of our various tables, made possible by the dependency
diagrams we have created.
• 1NF Check:
We have all possible candidate keys that determine our non-prime attributes, and we have tabular
format tables without any repeating groupings.
• 2NF Check:
Our tables are in 1NF, and they do not contain any partial dependencies.
• 3NF Check:
Our tables are in 2NF, and they do not contain any transitive dependencies.
• BCNF Check:
Our tables are in 3NF, and all determinants are candidate keys.
• 4NF Check:
Our tables are in BCNF, and they do not contain any multivalued dependencies.
–> Our tables meet all the requirements, and thus they are all in 4th Normal Form.
- Updated Tables:
o JOB Table:
JOB_ID (Primary Key, INT)
JOB_NAME (VARCHAR)
JOB_DESCRIPTION (VARCHAR)
o SUPPLIER Table:
SUP_ID (Primary Key, INT)
SUP_NAME (VARCHAR)
SUP_ADDRESS (VARCHAR)
SUP_PHONE
SUP_FAX
SUP_EMAIL
SUP_DETAILS
o CATEGORY Table:
CAT_ID (Primary Key, INT)
CAT_DESCRIPTION (VARCHAR)
CAT_NAME (VARCHAR)
o PAYMENT Table:
PAY_NUM (Primary Key, INT)
PAY_TYPE (VARCHAR)
PAY_DETAILS (VARCHAR)
o STAFF Table:
STAFF_ID (Primary Key, INT)
STAFF_FNAME (VARCHAR)
STAFF_LNAME (VARCHAR)
STAFF_ADDRESS (VARCHAR)
STAFF_PHONE (VARCHAR)
STAFF_EMAIL (VARCHAR)
STAFF_USERNAME (VARCHAR)
STAFF_PASSWORD (VARCHAR)
JOB_ID (Foreign Key references JOB.JOB_ID)
o PRODUCT Table:
PRO_ID (Primary Key, INT)
PRO_NAME (VARCHAR)
PRO_QNT (INT)
PRO_DESCRIPTION (VARCHAR)
SUP_ID (Foreign Key references SUPPLIER.SUP_ID)
CAT_ID (Foreign Key references CATEGORY.CAT_ID)
o PRODUCT_DETAILS Table:
PRO_ID (Primary Key, INT)
PRO_UNIT (VARCHAR)
PRO_PRICE (DECIMAL)
PRO_DETAILS (VARCHAR)
PRO_STATUS (VARCHAR)
o ORDER Table:
ORDER_ID (Primary Key, INT)
ORDER_DATE (DATE)
CUS_ID (Foreign Key references CUSTOMER.CUS_ID)
ORDER_DETAILS Table:
ORDERD_ID (Primary Key, INT)
ORDER_DETAILS (VARCHAR)
o CUSTOMER Table:
CUS_ID (Primary Key, INT)
CUS_FNAME (VARCHAR)
CUS_LNAME (VARCHAR)
CUS_ADDRESS (VARCHAR)
CUS_PHONE (VARCHAR)
CUS_EMAIL (VARCHAR)
STAFF_ID (Foreign Key references STAFF.STAFF_ID)
- Relationships:
JOB to STAFF (1:M)
STAFF to CUSTOMER (1:M)
ORDER to ORDER DETAILS (1:M)
PAYMENT to ORDER DETAILS (1:M)
PRODUCT to ORDER DETAILS (1:M)
SUPPLIER to PRODUCT (1:M)
CATEGORY to PRODUCT (1:M)
- Updated ERD: