Avoiding Database Anomalies - PowerPoint PPT Presentation

avoiding database anomalies n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Avoiding Database Anomalies PowerPoint Presentation
Download Presentation
Avoiding Database Anomalies

play fullscreen
1 / 17
Avoiding Database Anomalies
550 Views
Download Presentation
gur
Download Presentation

Avoiding Database Anomalies

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Avoiding Database Anomalies

  2. Unnormalized Relation

  3. 3a. First Normal Form (1NF) A relation is in first normal form if it does not contain repeating groups.

  4. Unnormalized Relation

  5. First Normal Form (1NF) Changes to service names have to be made on each line on which the the name appears.

  6. First Normal Form (1NF) Inconsistent data could result when the same service name has several name variations.

  7. First Normal Form (1NF) New services can not be added unless there is an existing transaction.

  8. First Normal Form (1NF) Deletion of an invoice could result in a loss of service information.

  9. Second Normal Form (2NF) A relation is in second normal form if it is in first normal form and there are no partial dependencies. A partial dependency occurs when a table has a composite primary key and a non-key attribute is dependent on only part of the primary key.

  10. Relations in Second Normal Form (2NF) Changes to customer names have to be made on each line on which the customer appears.

  11. Relations in Second Normal Form (2NF) Inconsistent data could result when the same customer has several name variations.

  12. Relations in Second Normal Form (2NF) New customers can not be added unless there is an existing transaction for the customer.

  13. Relations in Second Normal Form (2NF) Deletion of an invoice could result in the loss of customer information.

  14. Third Normal Form (3NF) A relation is in third normal form if it is in second normal form and there are no transitive dependencies. A transitive dependency occurs when a table has a non-key attribute that is dependent on another non-key attribute.

  15. Relations in Third Normal Form (3NF)

  16. Table Relationships 1-M Relationship REVENUE TRANSACTIONS CUSTOMER ACCOUNTS Invoice # Transaction Date Customer # Customer # Customer Name Foreign Key M-N Relationship REVENUE TRANSACTIONS SERVICES Invoice # Transaction Date Customer # Service Type # Service Name Hourly Rate 1 1 Bridge Table REVENUE TRANSACTION LINES M M Invoice # Service Type # Hours

  17. Success!