Entity-Relationship Model



Similar documents
Use a high-level conceptual data model (ER Model). Identify objects of interest (entities) and relationships between these objects

The example is taken from Sect. 1.2 of Vol. 1 of the CPN book.

Chapter 3. Data Modeling Using the Entity-Relationship (ER) Model

Architecture of the proposed standard

Entity-Relationship Model

Category 7: Employee Commuting

THE ENTITY- RELATIONSHIP (ER) MODEL CHAPTER 7 (6/E) CHAPTER 3 (5/E)

Adverse Selection and Moral Hazard in a Model With 2 States of the World

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

QUANTITATIVE METHODS CLASSES WEEK SEVEN

June Enprise Rent. Enprise Author: Document Version: Product: Product Version: SAP Version:

Free ACA SOLUTION (IRS 1094&1095 Reporting)

Basis risk. When speaking about forward or futures contracts, basis risk is the market

Logo Design/Development 1-on-1

Traffic Flow Analysis (2)

ER & EER to Relational Mapping. Chapter 9 1

by John Donald, Lecturer, School of Accounting, Economics and Finance, Deakin University, Australia

Econ 371: Answer Key for Problem Set 1 (Chapter 12-13)

Remember you can apply online. It s quick and easy. Go to Title. Forename(s) Surname. Sex. Male Date of birth D

Lecture 3: Diffusion: Fick s first law

Sci.Int.(Lahore),26(1), ,2014 ISSN ; CODEN: SINTE 8 131

Mathematics. Mathematics 3. hsn.uk.net. Higher HSN23000

The international Internet site of the geoviticulture MCC system Le site Internet international du système CCM géoviticole

5 2 index. e e. Prime numbers. Prime factors and factor trees. Powers. worked example 10. base. power

WORKERS' COMPENSATION ANALYST, 1774 SENIOR WORKERS' COMPENSATION ANALYST, 1769

Data warehouse on Manpower Employment for Decision Support System

Lecture 20: Emitter Follower and Differential Amplifiers

FACULTY SALARIES FALL NKU CUPA Data Compared To Published National Data

Cookie Policy- May 5, 2014

Attached Benefit Enrollment Forms must be returned to the Business Office within 30 days after your first day of work

GOAL SETTING AND PERSONAL MISSION STATEMENT

Question 3: How do you find the relative extrema of a function?

AP Calculus AB 2008 Scoring Guidelines

SPECIAL VOWEL SOUNDS

Cloud and Big Data Summer School, Stockholm, Aug., 2015 Jeffrey D. Ullman

Long run: Law of one price Purchasing Power Parity. Short run: Market for foreign exchange Factors affecting the market for foreign exchange

CPU. Rasterization. Per Vertex Operations & Primitive Assembly. Polynomial Evaluator. Frame Buffer. Per Fragment. Display List.

Business rules FATCA V. 02/11/2015

Continuity Cloud Virtual Firewall Guide

Constraint-Based Analysis of Gene Deletion in a Metabolic Network

union scholars program APPLICATION DEADLINE: FEBRUARY 28 YOU CAN CHANGE THE WORLD... AND EARN MONEY FOR COLLEGE AT THE SAME TIME!

Chapter 2: Entity-Relationship Model. E-R R Diagrams

Parallel and Distributed Programming. Performance Metrics

Gold versus stock investment: An econometric analysis

User-Perceived Quality of Service in Hybrid Broadcast and Telecommunication Networks

Keywords Cloud Computing, Service level agreement, cloud provider, business level policies, performance objectives.

Category 11: Use of Sold Products

A Note on Approximating. the Normal Distribution Function

ME 612 Metal Forming and Theory of Plasticity. 6. Strain

C H A P T E R 1 Writing Reports with SAS

IBM Healthcare Home Care Monitoring

Key Management System Framework for Cloud Storage Singa Suparman, Eng Pin Kwang Temasek Polytechnic

Enforcing Fine-grained Authorization Policies for Java Mobile Agents

New Basis Functions. Section 8. Complex Fourier Series

A Project Management framework for Software Implementation Planning and Management

MAXIMAL CHAINS IN THE TURING DEGREES

Database Systems. Session 3 Main Theme. Enterprise Data Modeling Using The Entity/Relationship (ER) Model. Dr. Jean-Claude Franchitti

CSC 742 Database Management Systems

Electronic Commerce. and. Competitive First-Degree Price Discrimination

Category 1: Purchased Goods and Services

Projections - 3D Viewing. Overview Lecture 4. Projection - 3D viewing. Projections. Projections Parallel Perspective

REPORT' Meeting Date: April 19,201 2 Audit Committee

Planning and Managing Copper Cable Maintenance through Cost- Benefit Modeling

A Theoretical Model of Public Response to the Homeland Security Advisory System

2. Conceptual Modeling using the Entity-Relationship Model

CPS 220 Theory of Computation REGULAR LANGUAGES. Regular expressions

Dehumidifiers: A Major Consumer of Residential Electricity

We know how to query a database using SQL. A set of tables and their schemas are given Data are properly loaded

Foreign Exchange Markets and Exchange Rates

SCHOOLS' PPP : PROJECT MANAGEMENT

B April 21, The Honorable Charles B. Rangel Ranking Minority Member Committee on Ways and Means House of Representatives

5.4 Exponential Functions: Differentiation and Integration TOOTLIFTST:

An Broad outline of Redundant Array of Inexpensive Disks Shaifali Shrivastava 1 Department of Computer Science and Engineering AITR, Indore

Combinatorial Analysis of Network Security

Foundations of Information Management

An IAC Approach for Detecting Profile Cloning in Online Social Networks

TIME MANAGEMENT. 1 The Process for Effective Time Management 2 Barriers to Time Management 3 SMART Goals 4 The POWER Model e. Section 1.

Voice Biometrics: How does it work? Konstantin Simonchik

Essays on Adverse Selection and Moral Hazard in Insurance Market

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

Lecture notes: 160B revised 9/28/06 Lecture 1: Exchange Rates and the Foreign Exchange Market FT chapter 13

YouthWorks Youth Works (yüth- w rkz), n.

Lift Selection Guide

ESTIMATING VEHICLE ROADSIDE ENCROACHMENT FREQUENCY USING ACCIDENT PREDICTION MODELS

Personal Identity Verification (PIV) Enablement Solutions

OPINION NO December 28, 1990

Abstract. Introduction. Statistical Approach for Analyzing Cell Phone Handoff Behavior. Volume 3, Issue 1, 2009

Have Debit Cards Changed Thai Consumer Shopping Behavior?

Vector Network Analyzer

Database Management Systems

On the moments of the aggregate discounted claims with dependence introduced by a FGM copula

Upper Bounding the Price of Anarchy in Atomic Splittable Selfish Routing

Product Overview. Version 1-12/14

CHAPTER 3: DATA MODELING USING THE ENTITY-RELATIONSHIP MODEL

UNIVERSITY OF NAIROBI SCHOOL OF COMPUTING & INFORMATICS IMPROVING APPLICATION OF KNOWLEDGE MANAGEMENT SYSTEMS IN ORGANIZATIONS:

est with berkeley / uc berkeley exte xtension / be your best with berkel

Transcription:

Entity-Rlationship Modl Kuang-hua Chn Dpartmnt of Library and Information Scinc National Taiwan Univrsity A Company Databas Kps track of a company s mploys, dpartmnts and projcts Aftr th rquirmnts collction and analysis phas dsignrs statd som dscription of th miniworld th part of th company to b rprsntd ER-

Dscription of COMPANY Databas Th company is organizd into dpartmnts Each dpartmnt has a uniqu nam, a uniqu numbr, and a particular mploy who manags th dpartmnt W kp track of th start dat whn that mploy bgan managing th dpartmnt A dpartmnt may hav svral locations A dpartmnt controls a numbr of projcts, ach of which has a uniqu nam, a uniqu numbr, and a singl location W stor ach mploy s nam, social scurity numbr, addrss, salary, sx and birthdat ER-3 Dscription of COMPANY Databas (Continud) An mploy is assignd to on dpartmnt but may work on svral projcts, which ar not ncssarily controlld by th sam dpartmnt W kp track of th numbr of hours pr wk that an mploy works on ach projct W also kp track of th dirct suprvisor of ach mploy W want to kp track of th dpndnts of ach mploy for insuranc purposs W kp ach dpndnt s nam, sx, birthdat, and rlationship to th mploy ER-4

ER schma diagram for th COMPANY databas Fnam Minit Lnam Nam Addrss SSN Sx Salary Bdat EMPLOYEE N WORKS_FOR Numbr Nam Locations StartDat NumbrOfEmploys MANAGES DEPARTMENT CONTROLS suprvisor suprvis SUPERVISION N M Hours WORKS_ON DEPENDENTS_OF N N PROJECT Nam Location Numbr N DEPENDENT Nam Sx BirthDat Rlationship ER-5 Entitis and Attributs Entity, which is a thing in th ral world with an indpndnt xistnc an objct with a physical xistnc -- a particular prson, car, hous, or mploy an objct with a concptual xistnc -- a company, a job, or a univrsity cours Each ntity has particular proprtis, calld attributs mploy ntity may b dscribd by th mploy s nam, ag, addrss ER-6

Entitis and Attributs (Continud) A particular ntity will hav a valu for ach of its attributs Th attribut valus that dscrib ach ntity bcom a major part of th data stord in th databas ER-7 Typs of Attribut Composit attributs can b dividd into smallr subparts, which rprsnt mor basic attributs with indpndnt manings of thir own Attributs that ar not divisibl ar calld simpl or atomic attributs Most attributs hav a singl valu for a particular ntity; such attributs ar calld singl-valud In som cass an attribut can hav a st of valus of th sam ntity, such attributs ar calld multivalud ER-8

Typs of Attribut (Continud) In som cass two (or mor) attribut valus ar rlatd -- for xampl, th Ag attribut is hnc calld a drivd attribut and is said to b drivabl from th BirthDat attribut, which is calld a stord attribut A null valu for an attribut: A particular ntity may not hav any applicabl valu for an attribut Null can also b usd if w do not know th valu of an attribut for a particular ntity ER-9 Sampl Entitis with Attribut Valus Nam=John Smith Addrss=3 Kirby, Houston, Txas 7700 c Nam=Sunco Oil Hadquartrs=Houston Ag=55 HomPhon=73-749-630 Prsidnt=John Smith ER-0

A Hirarchy of Composit Attributs Addrss StrtAddrss City Stat Zip Numbr Strt ApartmntNumbr ER- Entity Typs An ntity typ dfins a st of ntitis with th sam attributs EMPLOYEE and COMPANY ENTITY TYPE KEY ATTRIBUTE ATTRIBUTE MULTIVALUED ATTRIBUTE An ntity typ dscribs th schma or intnsion Th individual ntitis of a particular ntity typ ar groupd into a collction or ntity st (xtnsion) ER-

Two Entity Typs and Mmbr Entitis ENTITY TYPE NAME: ATTRIBUTES: ENTITY SET: (EXTENSION) EMPLOYEE Nam, Ag, Salary (John Smith, 55, 80k) (Frd Brown, 40, 30k) 3 (Judy Clark, 5, 0k) COMPANY Nam, Hadquartrs, Prsidnt c (Sunco Oil, Houston, John Smith) c (Fast Computr, Kallas, Bob King) ER-3 Ky Attributs An ntity typ has an attribut whos valus ar distinct for ach individual ntity Its valu can b usd to idntify ach ntity uniquly g Nam attribut for COMPANY, SocialScurityNumbr for PERSON Somtims, svral attributs togthr form a ky Ky attribut must hold for all xtnsions Som ntity typs hav mor than on ky attribut ER-4

Th CAR Entity Typ Rgistration(RgistrationNumbr, Stat), VhiclID, Mak, Modl, Yar, {Color} car ((ABC 3,TEXAS), TK69, Ford Mustang, convrtibl, 989,{rd, black}) car CAR ((ABC 3,NEW YORK), WP987, Nissan Sntra, -door, 99, {blu}) car3 ((VSY 70, TEXAS), TD79, Chryslr LBaron, 4-door, 993, {whit, blu}) ER-5 Valu Sts A valu st (or domain) spcifis th st of valus that may b assignd to that attribut th valu st for Ag attribut of EMPLOYEE is 6 to 70 Valu sts ar not displayd in ER diagram Th valu st V for an attribut A of ntity typ E can b dfind as a function from E to th powr st of V AE PV ER-6

Initial Concptual Dsign for COMPANY Databas An ntity typ DEPARTMENT with attributs Nam, Numbr, Locations, Managr, and ManagrStartDat Locations is th only multivalud attribut W can spcify that ach of Nam and Numbr is a ky attribut, bcaus ach was spcifid to b uniqu An ntity typ DEPENDENT with attributs Employ, DpndntNam, Sx, BirthDat, and Rlationship (for th mploy) ER-7 Initial Concptual Dsign for COMPANY Databas (Continud) An ntity typ PROJECT with attributs Nam, Numbr, Location, and ControllingDpartmnt Each of Nam and Numbr is a ky attribut An ntity typ EMPLOYEE with attributs Nam, SSN, Sx, Addrss, Salary, BirthDat, Dpartmnt, and Suprvisor Both Nam and Addrss may b composit attributs W must go back to th usrs to s if any of thm will rfr to th individual componnts of Nam -- FirstNam, MiddlInitial, LastNam -- or of Addrss ER-8

Prliminary Dsign of Entity Typs DEPARTMENT Nam, Numbr, {Locations}, Managr, ManagrStartDat PROJECT Nam, Numbr, Location, ControllingDpartmnt EMPLOYEE Nam(Fnam, Minit, Lnam), SSN, Sx, Addrss, Salary, BirthDat, Dpartmnt, Suprvisor, {WorksOn(Projct, Hours)} DEPENDENT Employ, DpndntNam,Sx, BirthDat, Rlationship ER-9 Rlationships Rlationship Typs and Rlationship Instancs: A rlationship typ R among n ntity typs E,E,,En dfins a st of associations among ntitis from ths typs R is a st of rlationship instancs ri, whr ach ri associats n ntitis (,,,n), and ach ntity j in ri is a mmbr of ntity typ Ej, j n ER Modl: RELATIONSHIP TYPE ER-0

Instancs of th WORKS_FOR Rlationship EMPLOYEE WORKS_FOR DEPARTMENT 3 4 5 6 7 r r r3 r4 r5 r6 r7 d d d3 ER- Dgr of a Rlationship Typ Each of th ntity typs E,E,En is said to participat in th rlationship typ R, and similarly ach of th individual ntitis,,,n is said to participat in th rlationship instanc ri=(,,, n) Th dgr of a rlationship typ is th numbr of participating ntity typs A rlationship typ of dgr two is calld binary, and on of dgr thr is calld trnary ER-

Th Trnary Rlationship SUPPLY SUPPLIER s s PART p p p3 SUPPLY r r r3 r4 r5 r6 r7 PROJECT j j j3 ER-3 Rol Nams and Rcursiv Rlationships Th rol nam signifis th rol that a participating ntity plays in ach rlationship instanc Whn all ntity typs ar distinct, rol nam is not ndd Somtims, th sam ntity typ participats mor than onc in a rlationship typ is diffrnt rols ER-4

Rcursiv Rlationship SUPERVISION SUPERVISION EMPLOYEE 3 4 5 6 7 suprvisor () and suprvis () r r r3 r4 r5 r6 ER-5 Constraints on Rlationship Typs Cardinality ratio spcifis th numbr of rlationship instancs that an ntity can participat in Participation constraint spcifis whthr th xistnc of an ntity dpnds on its bing rlatd to anothr ntity via th rlationship typ Structural constraints cardinality ratio + participation constraint ER-6

Cardinality Ratio DEPARTMENT:EMPLOYEE :N EMPLOYEE:PROJECT M:N (WORK_ON) EMPLOYEE:DEPARTMENT : (MANAGE) ER-7 Th : Rlationship Manags EMPLOYEE 3 4 5 6 7 MANAGES r r r 3 DEPARTMENT d d d 3 EMPLOYEE: partial participation; DEPARTMENT: total participation ER-8

Th M:N rlationship WORKS_ON WORKS_ON EMPLOYEE 3 4 r r r 3 r 4 r 5 r 6 r 7 PROJECT P P P3 P4 ER-9 Total Participation Constraint if vry mploy must work for a dpartmnt, th ntity EMPLOYEE in WORKS_FOR is calld total somtims calld xistnc dpndncy Partial som or part of th st of mploy ntitis ar rlatd ot a dpartmnt ntity via MANAGES, but not ncssarily all ER-30

Attributs of Rlationship Th numbr of hours pr wk that an mploy works on a projct Attributs of : or :N rlationship typs can b migratd ot on of th participating ntity typs StartDat of MANAGES may b migratd to EMPLOYEE or DEPARTMENT For M:N rlationship, th attribut should b dtrmind by th combination of participating ntitis ER-3 Wak Entity Typs Entity typ without any ky attribut is calld wak ntity typ Entitis of a wk ntity typ is idntifid by spcific ntitis from anothr ntity typ via idntifying rlationship A wak ntity typ always has a total participation constraint ER-3

Structur Constraints Spcifying structural constraints involvs associating a pair of intgr numbrs (min, max) with ach participation of an ntity typ E in a rlationship R 0<=min<=max, max>= Each ntity in E must participation in at last min and at most max rlationship instancs in R min=0 mans partial participation min>0 mans total participation ER-33 ER Diagram for th COMPANY Schma Fnam Minit Lnam Nam Addrss Ssn Sx Salary Bdat EMPLOYEE (0,N) (0,) suprvisor suprvis SUPERVISION (0,N) mploy DEPENDENTS_OF WORKS_ON (,N) projct Nam Numbr Locations Numbr CONTROLS WORKS_FOR (4,N) Nam (,) mploy dpartmnt NumbrOfEmploys StartDat (0,) (,) managr MANAGES dpartmntmanagd (,N) workr Hours DEPARTMENT controllingdpartmnt (0,N) controlldprojct (,) PROJECT Location dpndnt (,) DEPENDENT Nam Sx BirthDat Rlationship ER-34

Summary of ER Diagram Notation Symbol Maning Symbol Maning ENTITY TYPE WEAK ENTITY TYPE COMPOSITE ATTRIBUTE RELATIONSHIP TYPE DERIVED ATTRIBUTE IDENTIFYING RELATIONSHIP TYPE ATTRIBUTE KEY ATTRIBUTE MULTIVALUED ATTRIBUTE E R TOTAL PARTICIPATION E OF E IN R N CARDINALITY RATIO :N E R E FOR E:E IN R R (min,max) E STRUCTURAL CONSTRAINT (min, max) ON PARTICIPATION OF E IN R ER-35 (a) (b) (c) Trnary Rlationship Typs SNam Quantity SUPPLIER SUPPLY PartNo PART ProjNam PROJECT Th trnary rlationship typ SUPPLY SNam ProjNam SUPPLIER M SUPPLIES N PROJECT M M CAN_SUPPLY PartNo USES N PART N SNam Quantity ProjNam SUPPLIER SS N SUPPLY N SPJ PROJECT N PartNo SP SUPPLY rprsntd as a wak ntity typ PART ER-36

TAUGHT_DURING Smstr Yar INam INSTRUCTOR OFFERS Sm_Yar SEMESTER CAN_TEACH CNumbr OFFERED_DURING Anothr xampl of trnary vrsus binary rlationship typs COURSE Nam CANDIDATE CCI CNam COMPANY Dpartmnt Dat Dpt/Dat A wak ntity typ INTERVIEW, with a trnary idntifying rlationship typ INTERVIEW RESULTS_IN JOB_OFFER ER-37