Sie sind auf Seite 1von 18

Entity-Relationship Model

SE 157A, Fall Semester 2006 Robert Correll

Entity-Relationship Model (chapter 6)

Basic Concepts Constraints, Keys, and Design Issues Entity-Relationship Diagram Extended E-R Features Design of an E-R Database Schema Reduction of an E-R Schema to Tables Unified Modeling Language (UML)

Basic Concepts

o o o o

Logical structure of database system Requires iterative and incremental process Requirements, analysis, design, Inception, elaboration, construction, 1 Overall objective: Minimize redundancy (space and updates) Maximize effectiveness (the right product)

Constraints, Keys, and Design Issues

o
o o o

Job Search Activity System: A thorough record of events Helps in demonstrating competency Activity example: received automated reply Requirements specification

Requirements Specification

o
o o o o o

Track activities associated with job search: List companies or locations of a company List contacts per location or per job List jobs per zip code or per contact List activity per contact, company, or job List follow-up dates per contact List referrals (recursive relationship)

Entity-Relationship Diagram

Identify entity sets Determine attributes Analyze interactions between entities Draw the E-R Diagram Remember iterative and incremental process.

Identify Entity Sets

One job seeker Activity Company Location Job Contact Pending follow-up date

Determine Attributes
company_id stock_symbol web_site last_search_date state co_name

location_id -------city

street

zip_code

company

location

Shows a derived attribute: last_search_date.

Determine Attributes (continued)


prefix
my_job_id position co_job_id position_type source contact_id title rapor_level first_name last_name name telephone

job_status
last_activity_date email

job

contact

Shows composite attribute name, which includes the attributes prefix, first_name, and last_name.

Determine Attributes (continued)


activity_date activity_code activity_time comment activity_code description

activity_description

activity
contact_id follow-up_date

job_seeker

follow-up

Each description represents a specific job search activity.

Activity Description Codes


1 2 3 4 Conducted search but did not apply Applied on company website E-mailed resume Sent resume via regular mail

5
6 7 8 9 10 11

Received automated reply


Received personalized e-mail Received voice mail message Received call and spoke over phone Left contact voice mail message Called contact and spoke over phone Had on-site interview

Analyze Interactions
company_id stock_symbol web_site last_search_date state zip_code co_name location_id -------street city

company

company_location

location

Weak entity set with discriminator

Extended E-R Features

Specialization: superclass-subclass (ISA) Generalization: entity sets share attributes Attribute inheritance: higher- and lower-level Aggregation: back-to-back relation sets

Design of an E-R Database Schema for a Job Search Activity System


position
position_type company_id co_name location_id -------city street zip_code source state my_job_id co_job_id

stock_symbol web_site
last_search_date

job_status

company

company_location

location

job_contact

job

job_seeker

referred_by

looking

activity

event
contact_id

contact
email

comment

follow-up
activity_description
contact_id activity_time follow-up_date activity_date my_job_id activity_code description last_actiity_date rapor_level telephone name title

activity_code

prefix

first_name

last_name

Open Design Issues

Should location_id values begin with number 1 for each company? Job_type: regular, internship, contract, unsolicited Job_status: hot, warm, cold, filled, not qualified More job entity attributes: job_spec, target_date Job_contact entity: contact_id, my_job_id

Reduction of an E-R Schema to Tables

Company = (company_id, co_name, web_site, stock_symbol)

company_id 1 2

co_name Cisco Symantec

web_site www.cisco.com www.symantec.com

stock_symbol CSCO SYMC

Intel

www.intel.com

INTC

Unified Modeling Language (UML)

Cardinality constraints are presented differently between ERD and UML: ERD
E1
0..*

0..1

E2

UML
E1
0..1 R 0..*

E2

References
1.

2.

3.

4.

Arlow, J., UML 2 and the Unified Process, Second Edition, 2005. Kroenke D., Database Concepts, Second Edition, 2005. Silberschatz, A., Korth H., Sudarshan, S. Database System Concepts, Fifth Edition, 2005 Silberschatz, A., Korth H., Sudarshan, S: Database System Concepts, Fourth Edition, 2002

Das könnte Ihnen auch gefallen