Beruflich Dokumente
Kultur Dokumente
NEHA J MENDJOGE
ENTITY SETS
An entity is an thing or object that exists in
the real world and is distinguishable from other objects. Example: specific person, company, event, plant
Every entity has a set of properties i.e. the
REPRESENTING ENTITIES
ENTITY_NAME
NEHA J MENDJOGE
EXAMPLE OF ENTITIES
CUSTOMER_NA ME
CUSTOMER_ ID CUSTOMER_CIT Y CUSTOMER_STR EET
CUSTOMER
NEHA J MENDJOGE
NEHA J MENDJOGE
TYPES OF ATTRIBUTES
SIMPLE: COMPOSITE
NEHA J MENDJOGE
EXAMPLE OF ATTRIBUTES
CUSTOMER_STR EET CUSTOMER_ ID
CUSTOMER_DAT E_OF_BIRTH
TELNO
CUSTOMER
AGE
NAME
FNAME
MNAME
LNAME
NEHA J MENDJOGE
EXAMPLE OF ATTRIBUTES
CUSTOMER_STR EET CUSTOMER_ ID
CUSTOMER_DAT E_OF_BIRTH
TELNO
CUSTOMER
AGE
NAME
FNAME
MNAME
LNAME
NEHA J MENDJOGE
RELATIONSHIP SETS
A relationship is an association among several
entities
HA S
ACCOUNT
NEHA J MENDJOGE
a relationship set.
Relationship sets that involve two entity sets are
binary (or degree two). Generally, most relationship sets in a database system are binary.
10
NEHA J MENDJOGE
MAPPING CARDINALITIES
Express the number of entities to which
One to one
One to many Many to one Many to many
11
NEHA J MENDJOGE
ONE TO
12
NEHA J MENDJOGE
MANY TO
13
NEHA J MENDJOGE
CARDINALITY CONTRAINTS
ONE TO ONE RELATIONSHIP
14
NEHA J MENDJOGE
associated with at most one customer via borrower, a customer is associated with several (including 0) loans via borrower
15
NEHA J MENDJOGE
with several (including 0) customers via borrower, a customer is associated with at most one loan via borrower
16
NEHA J MENDJOGE
RELATIONSHIP
A customer is associated with several (possibly 0)
loans via borrower A loan is associated with several (possibly 0) customers via borrower
17
NEHA J MENDJOGE
18
NEHA J MENDJOGE
entity in the entity set participates in at least one relationship in the relationship set E.g. participation of loan in borrower is total every loan must have a customer associated to it via borrower Partial participation: some entities may not participate in any relationship in the relationship set E.g. participation of customer in borrower is partial
19
NEHA J MENDJOGE
KEYS
PRIMARY KEY: SUPER KEY: A super key of an entity set is a set
20
NEHA J MENDJOGE
22
NEHA J MENDJOGE
23
NEHA J MENDJOGE
Identifying relationshi p
SPECIALIZATION
The process of designating subgroupings within
an entity set.
Depicted by a triangle component labeled ISA
(E.g. customer is a person). Attribute inheritance a lower-level entity set inherits all the attributes and relationship participation of the higher-level entity set to which it is linked. The ISA relationship also referred to as superclass - subclass relationship
24 NEHA J MENDJOGE
25
NEHA J MENDJOGE
TERNARY RELATIONSHIP
27
NEHA J MENDJOGE
AGGREGATION
Suppose we want to record managers for a task
28
NEHA J MENDJOGE
29
NEHA J MENDJOGE
EXAMPLE
Construct an E-R diagram for a
hospital with a set of patients and a set of medical doctors. Associate with each patient a log of the various tests and examinations conducted.
30
NEHA J MENDJOGE