You are on page 1of 22

Entity-Relationship Model

Leo Mark
(May 2002)

The Real World


real customers

The Model

customer surrogates

Entity Type and entity surrogates

airport

entity type names must be unique

Single-valued Properties
airport

airport name

Hartsfield Kastrup

Logan

property values are lexical, visible, audible, .they are things that name other things

Identifying Properties
cph airport code atl lax bos

airport

for each identifying property value there is at most one instance of the identified entity every entity must be uniquely referenceable

Multi-valued Properties
th we mo flt-schedule mo mo we th su

weekdays

Composite Properties
airport airport street airport city airport zip airport address 1 Flughafen St 400 Flight Av 12 Logan Rd Hamburg Denver Boston 90123 56789 12345

1-1 relationship types


femalecustomer 1
current marriage

malecustomer

partial functions

the names of multiple relationship types between the same two entity types must be unique

0-N and 1-N relationship types


1 airport from N flt-schedule

partial function

Mandatory 0-N and 1-N relationship types


1 airport from N flt-schedule

total function

N-M relationship types


customer N reservation M flt-instance

N-ary relationship types


plane-partsupplier supplier# repairorder# L supply M quantity plane-part part#

N flt-repairorder

many ternary relationship types cannot be reduced to a conjunction of binary relationship types

Identifying relationship types & weak entity types


flt#

flt-instance cannot exist without flt-schedule flt-instance cannot be identified without fltschedule (flt#, date) identifies fltinstance

flt-schedule

from date flt-instance

recursive relationship types


out connection in

flt-schedule

flt#

departure time

arrival time

Are relationships entities? Or, are they just glue?


1 airport from N flt-schedule

departure time

relationships may have attributes for 1-N (and 1-1) relationships, attributes may be moved to the entity on the many-side

Are relationships entities? Or, are they just glue? (cont....)


customer N reservation M flt-instance

payment method

in N-M relationships, the attributes cannot be moved to the entities how can non-entities have attributes?

Are relationships entities? Or, are they just glue? (cont....)


customer N reservation M flt-instance

payment method

1 customer

reservation

flt-instance

payment method

An objectified relationship type

supertypes and subtypes?


Male
x

passenger
o

economy class passenger

Female

first class passenger

business class passenger

UNION entity types

company

person

payer

property or entity type?

family name customer

relationship type or entity type?


flt-instance

reservation

customer

Whats the Result Type of a Query?

You might also like