1 / 17

Avoiding Database Anomalies

Avoiding Database Anomalies. Unnormalized Relation. 3a. First Normal Form (1NF). A relation is in first normal form if it does not contain repeating groups. Unnormalized Relation. First Normal Form (1NF). Changes to service names have to be made on each line on which the the name appears.

alangreen
Download Presentation

Avoiding Database Anomalies

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

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!

More Related