The Entity-Relationship Model (Chapter 3a) Laku Chidambaram W.P. Wood Professor of MIS University of...
-
Upload
hugh-woods -
Category
Documents
-
view
213 -
download
0
Transcript of The Entity-Relationship Model (Chapter 3a) Laku Chidambaram W.P. Wood Professor of MIS University of...
The Entity-Relationship Model(Chapter 3a)
Laku Chidambaram W.P. Wood Professor of MISUniversity of Oklahoma
© Laku Chidambaram, Ph.D.
Overview
Database Design: The E-R Model
Entities
Attributes
Relationships
© Laku Chidambaram, Ph.D.
Database Design
EngineerEngineer(A/C Receivable)(A/C Receivable)
EngineerEngineer(A/C Receivable)(A/C Receivable)
PilotPilot(Order Entry)(Order Entry)
PilotPilot(Order Entry)(Order Entry)
PassengerPassenger (Inventory)(Inventory)
PassengerPassenger (Inventory)(Inventory)
ExternalView
General DesignGeneral Design(Comprehensive Data Model) (Comprehensive Data Model)
General DesignGeneral Design(Comprehensive Data Model) (Comprehensive Data Model)
ConceptualModel (ERD)
BlueprintBlueprint(Database Schema) (Database Schema)
BlueprintBlueprint(Database Schema) (Database Schema)
Logical Model(Relational)
AircraftAircraft(Database)(Database)
Physical Reality(DBMS)
© Laku Chidambaram, Ph.D.
The Entity Relationship Diagram
An E-R diagram is a graphical representation of an organization’s data
Such data includes the people, places,
objects, events, or concepts (along with their characteristics and relationships) that are relevant to an organization
© Laku Chidambaram, Ph.D.
Entities
Person, place, object, event, or concept about which the organization wishes to collect and maintain data
Nouns are used to describe entitiesExamples:
Employee, Student, Nurse City, State, Country Sale, Registration, Account
Entity Type versus Entity Instance
© Laku Chidambaram, Ph.D.
Types of Entities
Strong Entity: can exist independently
Weak Entity: cannot exist without the “owner” entity (with which it has an identifying relationship) Has a primary key that is derived from the owner entity in
the relationship
EMPLOYEE
EMPLOYEEhas
DEPENDENT
© Laku Chidambaram, Ph.D.
Attributes
Properties or characteristics of entities (or relationships)
Provide the actual data that describe entities (or relationships)
EMPLOYEE
E_Address
E_Name
E_ID
© Laku Chidambaram, Ph.D.
Unique Attributes
Candidate keys are ALL attributes that uniquely define an instance of an entity
A primary key is the candidate key that is chosen as the “most” unique of them all!
A primary key (or identifier) is ideal if it: does not change over time has unique values that are not null does not use “intelligent” features (Note: may need to substitute simple keys for long,
i.e., composite, keys)
© Laku Chidambaram, Ph.D.
Composite Attributes
Attributes that are not “atomic” (or simple), i.e., those attributes that can (and need to) be broken down further
EMPLOYEE
E_Address (E_Street,
E_City,
E-Zip)
E_Name
E_ID
© Laku Chidambaram, Ph.D.
Multi-valued Attributes
Some attributes may have multiple values ...
… but they may need to be “fixed” before proceeding
EMPLOYEE{E_Skill}
EMPLOYEE has SKILL
S_Code
S_Name
© Laku Chidambaram, Ph.D.
Derived Attributes
Those attributes whose values can be calculated from the values of other attributes (either in the database or in the system).
Value is not stored in the database (since it does not take up any space) E.g., Age can be calculated, where date-of-birth is stored
© Laku Chidambaram, Ph.D.
RelationshipsRefer to the associations (or links) between entitiesUse verbs to describe the links May have attributes (in some cases)Are directional
STUDENTLives in
DORMITORY
EMPLOYEE Works in STORE STORE
© Laku Chidambaram, Ph.D.
Associative Entities
A (many-to-many) relationship that is better represented as an entity because it: contains attributes from the entities it links
and has its own attributes has independent meaning to end-users
CUSTOMEROrders PRODUCT
CUSTOMER ORDER PRODUCT