1 - Database Intro

Avoid mistake like this specify primary and foreign

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: and Carson Woo 35 BUSI 335 Copyright © 2009-10 Y.M. Cheung, William Tan and Carson Woo 36 Referential Integrity (cont’d) Referential Integrity (cont Referential Integrity: Example Integrity: Example • A condition by which a child table's foreign key Can override the restrictions against deleting or changing related records and still preserve referential integrity by selecting the Cascade Update Related Fields and Cascade Delete Related Records for Delete Related Records, for example: must have either null entry or matching must have either a null entry or a matching entry in the parent table • Control over data inconsistency by ensuring that relationships between records in related tables tables are valid, for example: – Can't delete a record from a primary table if matching records exist in a related table. hi if Cascade Update Related Fields is set, what happens when a primary key value in the primary table is changed? – Can't change a primary key value in the primary table if that record has related records table, if that record has related records. BUSI 335 Copyright © 2009-10 Y.M. Cheung, William Tan and Carson Woo 37 BUSI 335 Copyright © 2009-10 Y.M. Cheung, William Tan and Carson Woo Entity-Relationship Diagram (ERD) (ERD) An ER Model is detailed is a detailed, logical representation of the data for an organization or a business area. area. address name m Order Customer (0, N) customer # item name date n Entity ERD using the Crow’s Foot Notation Foot Notation Item # Item unit price Connectivity Relationship Cardinality Type address name date customer # stock qty Entity Attribute item name Order Customer (0, N) qty 38 Cardinality Item # Item unit price Relationship Cardinality Type stock Attribute • A technique to describe things and their relationships techniq to describe things and their relationships BUSI 335 Copyright © 2009-10 Y.M. Cheung, William Tan and Carson Woo 39 BUSI 335 Copyright © 2009-10 Y.M. Cheung, William Tan and Carson Woo 40 CUSTOMER: Entities Entit...
View Full Document

Ask a homework question - tutors are online