Presentation is loading. Please wait.

Presentation is loading. Please wait.

Guide to Modeling Keys to E-R diagrams.

Similar presentations


Presentation on theme: "Guide to Modeling Keys to E-R diagrams."— Presentation transcript:

1 Guide to Modeling Keys to E-R diagrams

2 Entities Things about which you need to store data. One entity for each different thing. At least two attributes At least two occurrences Not a property of some other entity Not a derived quantity (like a report)

3 Finding Entities List things described in a business narrative
List things that are read from or written to in the process analysis of the system Describe a record (occurrence) by listing the attributes it has Be certain you need to store data

4 Relationships Relationships connect a record in one entity to one or more records in another entity (A recursive relationship connects a record to records in the same entity) Relationships connect records (occurrences) not entities Relationships do not change anything (they are not processes)

5 Determining Relationships
Describe connections: has a, orders a, contains a, etc. on a common report page, line, etc. Connect records, not attributes Can be described by a passive phrase Do not describe a change in values

6 Cardinality How many records could be connected to this one?
Two sided test.

7 1:N and 1:1 1-1 relationships are special cases of 1:M
Foreign key in the many table

8 M:N Associations Associations with data
Associations that occur more than once

9 ATTRIBUTE: A description or property of a given entity type.
Must depend on the entity key alone Must contain information that we explicitly need Must have the same data type for all entity occurrences

10 TYPES OF ATTRIBUTES: Composite or Simple (atomic)
Single valued or Multivalued (repeating group) Relational database models cannot represent multivalued attributes but objects and structured databases can. Repeating groups (sets of related multivalued attributes) usually represent entities or subclasses.

11 Optionality (Referential Integrity)
Records in a table that have a relationship with another table may be restricted by optionality requirements. Relationship Optional Relationship Mandatory (referential integrity enforced)

12 Optionality A constraint should be mandatory only if the relationship must be known whenever a record is first entered. Most relationships are optional.

13 Maintaining Integrity
If a parent record is deleted then an optionality relationships can be maintained in several ways Cascade delete Cascade update Cascade null

14 Typical Patterns Simple “Ownership” Product Order Appointment
Journal Entry Component Parts


Download ppt "Guide to Modeling Keys to E-R diagrams."

Similar presentations


Ads by Google