Referential Integrity - PowerPoint PPT Presentation

rlc6009
itse 2347 l.
Skip this Video
Loading SlideShow in 5 Seconds..
Referential Integrity PowerPoint Presentation
Download Presentation
Referential Integrity

play fullscreen
1 / 13
Download Presentation
Referential Integrity
399 Views
Download Presentation

Referential Integrity

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

  1. ITSE 2347 Referential Integrity

  2. Referential Integrity Referential Integrityis an optional system of rules that guarantees the relationships are valid and the databases will remain intact as data is entered, edited, or deleted.

  3. Referential Integrity Basic RulesFor every record in a child table ( the “many” side) one and only one matching record must be in the parent table ( the “one” side).

  4. Referential Integrity Example Look at a Parent/Child relationship. Without a Parent there is no Child.

  5. Referential Integrity Example In order to have a work order you would need a customer that would be receiving the work. The Customer would be the Parent. The Work order would be the Child.

  6. Referential Integrity Before you can set referential integrity the following conditions must be met.

  7. Referential Integrity/ Conditions • The matching field in the parent table is the primary key or has a unique value. • Related Field are the same data type. • Both tables are in the same Database.

  8. Referential Integrity/ Conditions • Every record has one and only one matching record in the table.

  9. Tables can be joined in three ways • One-to-One • One-to-Many • Many-to-Many

  10. A one-to-many relationship A one-to-many relationship exists when one table has many records associated with a given value but the related table has only one record for that value. • The table with one record is called the primary table • The table with many records is called the related table

  11. A one-to-many relationship

  12. A one-to-many relationship One Employer------Many Positions

  13. A one-to-many relationship We can’t remove the Employer table because it would delete all of the employers from the Position table.