Notes of ENTITY RELATIONSHIP Modelling 1 Mrs Mousmi Ajay Chaurasia,Lect. Deptt.

Of Information Technology, BIT DURG

Entity – Relationship(ER) Modelling
ER Model Concepts
--Entities and Attributes -- Entity Types, Value Sets, and Key Attributes --Relationships and Relationship Types -- Weak Entity Types1 --Roles and Attributes in Relationship Types

A database can be modeled as:
– a collection of entities, – relationships among entities.

Entity/Relationship approach - one of the most well known modeling methods

Developed by P.Chen in 1976 - many variations since then Entity:A real-world object that can be distinctly identified may represent some

real physical object. E.g., Satish is a government employee; Kareena Kapoor is an actress; my car is a Honda City
May represent some conceptual idea E.g., SC304 is a course; Semester 1 2001/2002 is a semester

An entity is an object that exists and is distinguishable from other objects.
Example: specific person, company, event, plant

An entity set is a set of entities of the same type that share the same properties.
Example: set of all persons, companies, trees, holidays. An Entity should be:

An Object that will have many instances in the DB
• •

An Object that will have multiple attributes An Object that v r trying to model An Entity should not be:
• •

User of the DB An O/P of the DB(eg. Report)

Attributes:An entity is represented by a set of attributes, that is,descriptive properties
possessed by all members of an entity set.(value from corresponding entity) Example: customer = (customer-name, social-security, customer-street, customer-city) account = (account-number, balance) Domain – the set of permitted values for each attribute

Attribute types:

Simple and composite attributes.
• •

Single-valued and multi-valued attributes Null attributes
• •

Derived attributes Identifiers(Key) attributes

Notes of ENTITY RELATIONSHIP Modelling 2 Mrs Mousmi Ajay Chaurasia,Lect. Deptt. Of Information Technology, BIT DURG
Simple versus composite

Simple attributes are atomic.E.g. tel_ph; house color; basic-salary; Composite attributes made up of simple attributes. E.g., address = (St_add,city,state, postal code)

Composite Simple Key is underlined Single valued versus multivalued Single valued: single value associated with an attribute Multivalued: may have more than one values. E.g., University degree attribute may contain B.Eng., M.Eng., or Ph.D.

Composite attributes b/w( ) and separating with commas and multivalued b/w{ } . Such attributes r called COMPOSITE ATTRIBUTES Stored versus derived Most attribute values are stored eg birthdate. BUT Derived from stored value. E.g., age from birth date Null : An attribute takes a null value when an entity does not have a value for it. eg house_no Height of a person attribute ism issin g n homephone attribute is not known attribute. I Id de en nt ti if

fi ie er rs s( (K Ke ey ys s) ): An attribute(or combination of attributes) that uniquely identifies the instances of an entity type. Identifiers will not change in value,will not be null.No intelligent Identifiers( containing people or locations that might change). Derived Identifier Multivalued (from date_employ& current date) (employee can have more than 1 skill)

Notes of ENTITY RELATIONSHIP Modelling 3 Mrs Mousmi Ajay Chaurasia,Lect. Deptt. Of Information Technology, BIT DURG

Summary of ER diagram ,Notation of ER Schemas

Symbol Meaning ENTITY TYPE WEAK ENTITY TYPE RELATIONSHIP TYPE IDENTIFYING RELATIONSHIP TYPE ATTRIBUTE PRIMARY KEY ATTRIBUTE MULTIVALUED ATTRIBUTE COMPOSITE ATTRIBUTE DERIVED ATTRIBUTE TOTAL PARTICIPATION OF E2 IN R CARDINALITY RATIO 1:N FOR E1:E2 IN R ENTITY TYPE GENERALIZATION OR SPECIALIZATION PARTIAL KEY (WEAK ENTITY) ROLE INDICATOR RELATIONSHIP SETS: An association among entities.(set of relationship of the same type) A relationship set is a mathematical relation among n>= 2 entities, each taken from entity sets

{ (e1, e2, ..., en) | e1

E 1, e 2 E2, ..., en E n} where (e1, e2, ..., en) is a relationship– Example: (Hayes, A-102) depositor An attribute can also be a property of a relationship set. For instance, the depositor relationship set between entity sets customer and account may have the attribute access-date.

Notes of ENTITY RELATIONSHIP Modelling 4 Mrs Mousmi Ajay Chaurasia,Lect. Deptt. Of Information Technology, BIT DURG
Degree of the relationship sets: Refers to number of entity sets that participate in 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. Relationship sets may involve more than two entity sets. The entity sets customer, loan, and branch may be linked by the ternary (degree three) relationship set. Or may say: Urnary Relationship, Binary relationship, Ternary Relationship One entity related Entities of two different types Entities of three different to another of the same entity type related to each other types related to each other

Roles: Entity sets of a relationship need not be distinct.
The labels “manager” and “worker” are called roles; they specify how employee entities interact via the works-for relationship set. Roles are indicated in E-R diagrams by labeling the lines that connect diamonds to rectangles. Role labels are optional, and are used to clarify semantics of the relationship.

Notes of ENTITY RELATIONSHIP Modelling 5 Mrs Mousmi Ajay Chaurasia,Lect. Deptt. Of Information Technology, BIT DURG

Cardinality of Relationship:(Structural Constraints)

Express the number of entities to which another entity can be associated via a relationship set. Most useful in describing binary relationship sets For a binary relationship set the mapping cardinality must be one of the following types: – One to one: Each entity in the relationship must have exactly one related entity. – One to many (many to one): An entity in the relationship on one side can have many related entities but on the other side will have maximum of one related entity. – Many to many: Entities on both the sides can have many related entities on the other side. We distinguish among these types by drawing either a directed line ( ), signifying “one,” or an undirected line (—), signifying many,” between the relationship set and the entity set.

.

Unary Relationships: Binary Relationships: Ternary Relationships:

Note: Relationships can have Attributes of their own.

Notes of ENTITY RELATIONSHIP Modelling 6 Mrs Mousmi Ajay Chaurasia,Lect. Deptt. Of Information Technology, BIT DURG

Example of Binary Relationship: works_for relationship b/w EMPLOYEE entity type and DEPARTMENT entity type Each instance‘r ’ must relate one employee to one dept. Example for Ternary Relationship: Each instance of‘r ’ must be associated with three objects Example of 1:1 Relationship: DDL: customer(ssn,cust_nm,cust_st,cust_city) Loan( Loan_nmbr,amt) Borrower(ssn,loan_nmbr) OR customer(ssn,cust_nm,cust_st,cust_city) Loan( Loan_nmbr,amt) A customer is associated with at most one loan via the relationship borrower and a loan is associated with at most one customer via borrower.

If borrower also has attributes(say: amount,date) then DDL : borrower(amt,dt#)

Employee WORKS_FOR Department d1 d2 d3 r1 r2 r3 r4 r5 emp1 emp2 emp3 emp4 emp5

Notes of ENTITY RELATIONSHIP Modelling 7 Mrs Mousmi Ajay Chaurasia,Lect. Deptt. Of Information Technology, BIT DURG

Example of 1:M and M:1 Relationship: In the one-to-many relationship, a loan is associated with at most one customer via borrower; a customer is associated with several (including 0) loans via borrower In the many-to-one relationship, a loan is associated with several (including 0) customers via borrower; a customer is associated with at most one loan via borrower. Example of M:M Relationship: A customer is associated with several (possibly 0) loans via borrower. A loan is associated with several (possibly 0) customers via borrower. Each entity may result in a relation whose attributes are the properties for the entity .Each relationship may result in a relation whose attributes link the entities described in the relationship

Weak Entity Sets:A weak entity is an entity that cannot be uniquely identified by its own attributes
alone.

An entity set that does not have a primary key is referred to as a weak entity set.Has no key attributes.

w o s m s

T e n t u t

e k t r o s t r o

h a

h n n

e e e g r g

x n e

i t e e l

s i x n a

t t i t t

e y s i e

n t t

c s e y t

e e n o

o t c s e e t

f d t h

e o ; e

a p f i

e t

n a

d

s

set via a one-to-many relationship set.  T h e d i s c r i m i n a t o r ( o r p a r t i a l k e y ) o f a w e a k e n t i t y s e t i s t h e s e t o f a t t r i b u t e s t h a t d i s t i n g u i s h e s a m o n g a l l t h e entities of a weak entity set.(or Set of attributes that uniquely identify weak entities related to same owner entity).

w f k s

T e o e e

h a r y t

e k m

e o o

p e d f n

r n

i

t b t w

m i y h h

a t

r y t

y

e i

c

h s h

k s e e t r t

e t p

y

i r n e i g

o s m w

f

a

o h

a r e n e a

y t k i t y

entity set is existence dependent, plus the weak entity set’s discriminator.(Primary key of weak entity: identifying owner’s primary key + partial key) We depict a weak entity set by double rectangles. We underline the discriminator of a weak entity set with a dashed line.

ER Diagram
Reads: 31,664 Uploaded: 10/17/2008 Category: Uncategorized. Rated:
4.85714 5 false false 0

(7 Ratings) Download this Document for FreePrintMobileCollectionsReport Document This is a private document.

api_11797_mousmi_ash Follow

Share & Embed
http://w w w

Link / URL: Embed Size & Settings:
(auto)

• •

Width:
300

Auto (proportional to specified width)

Height:

1

• •

Start on page:
Scroll

Preview View:
<a title="Vie

More share options

Related
1. 11 p. E-R Model Printed Reads: 1943 49 p. 18189399 Entity Relationship Model Reads: 1182 49 p. Entity Relationship Model Reads: 5650 2. 45 p. DataBase Designing Reads: 184 89 p. Data Modeling ER Reads: 2486 15 p. computers Reads: 178 3. 80 p. Bagian 2 Pemodelan Konseptual Reads: 677 42 p. DBMS_Entity-Relationship Data Mode...

Reads: 286 20 p. E-R Model Reads: 1269 4. 5 p. DBMS- Lecture 3 Reads: 269 3 p. Sad Semifinals Reads: 156 25 p. ERD Reads: 0 5. 29 p. chapter10%5B1%5D Reads: 262 32 p. ERD Reads: 0 9 p. Comparison of Christian Denominati... Reads: 0 6. 6 p. 000-102demo Reads: 0 5 p. JTX - When is the Constitution Lik... Reads: 0 2 p. 198 Valuing Goodwill

Reads: 0 7. 26 p. Termpaper of Rm (2) Reads: 0 48 p. Sustainable Energy Security - Stra... Reads: 0 3 p. Prevention Without Hard Power: Mis... Reads: 0 8. 1 p. Publish Your Own Club Bulletin Reads: 0

More from this user
1. 5 p. Types of Failure and ACID Prope... From: api_11797_mousmi_ash Reads: 1,245 8 p. Serializability by Amit Gupta From: api_11797_mousmi_ash Reads: 340 30 p. Normal is at Ion 1 From: api_11797_mousmi_ash Reads: 398 2. 19 p. Dbms Concepts[1] From: api_11797_mousmi_ash Reads: 640 15 p. Relational Algebra From: api_11797_mousmi_ash Reads: 2,042

22 p. Intro to DBMS From: api_11797_mousmi_ash Reads: 4,864 3. 17 p. Recrd Strge Organization From: api_11797_mousmi_ash Reads: 230 23 p. ER Diagram From: api_11797_mousmi_ash Reads: 32,126
Top of Form

Login to Add a Comment

Submit

4gen

Bottom of Form

Lauretta Hewson read this about 6 hours agoLearn more about Readcast. uomads read this about 18 hours agoLearn more about Readcast.

Avinash Yadav read this about 19 hours agoLearn more about Readcast. nsyap72 read this 1 day agoLearn more about Readcast.

Shalin Asanga read this 1 day agoLearn more about Readcast.

Sayed Saeed read this 2 days agoLearn more about Readcast.

Venice Paculanan read this 3 days agoLearn more about Readcast.

Ravikumar Karunanithi read this 3 days agoLearn more about Readcast.

Bhuvnesh Goyal read this 4 days agoLearn more about Readcast. erjayantvaishnav read this 4 days agoLearn more about Readcast. Show More Ads by Google Cove Systems Inc.
Efficient Retail & Dist. Software CRM Rebates SCM WMS Vendor Shipping

www.covesys.com/ Database course at Aptech
50 lakh students trained already 22 years of expertise

www.Aptech-Education.com We Know Your Customer www.KYCnet.com
Faster - Smarter - Cheaper KYC Service & Software-as-a-Service

Print this document High Quality
Open the downloaded document, and select print from the file menu (PDF reader required).

Browser Printing
Coming soon!

Your download will begin shortly...

But first, we need a bit more information. Import more of your profile information from Facebook to help use find more content that you'll be interested in and build your social network on and off Scribd. No, thanks

Your download will begin shortly...
But first, we need a bit more information. Import more of your profile information from Facebook to help use find more content that you'll be interested in and build your social network on and off Scribd. No, thanks

Sign up
Use your Facebook login and see what your friends are reading and sharing. Other login options Login with Facebook
Top of Form

http://w w w .scrib

http://w w w .scrib
Bottom of Form

Signup
I don't have a Facebook account
Top of Form

default

email address (required) create username (required) password (required) Send me the Scribd Newsletter, and occasional account related communications. Privacy policy You will receive email notifications regarding your account activity. You can manage these notifications in your account settings. We promise to respect your privacy.
Bottom of Form

Why Sign up?
Discover and connect with people of similar interests. Publish your documents quickly and easily. Share your reading interests on Scribd and social sites.

Already have a Scribd account?
Top of Form

email address or username password
Log In

Trouble logging in?
Bottom of Form

Login Successful
Now bringing you back...

« Back to Login

Reset your password
Please enter your email address below to reset your password. We will send you an email with instructions on how to continue.
Top of Form

Email address: You need to provide a login for this account as well. Login:
Submit
Bottom of Form

Upload a Document
Top of Form

Search Books, Presentations, Business, Academics...
Bottom of Form

Scribd

• • • • •

About Press Jobs Contact Blog


Legal

Scribd Store Terms - General Terms - API Terms - Privacy Copyright Getting Started Community Guidelines Support & FAQ Web Stuff Partners / Publishers Branded Reader Developers / API On Scribd On Twitter On Facebook
Top of Form

• • • • • •

Help & Tools

• • • • • • •

Partners

Subscribe to Us

Enter your email address:
Sign Up

or
Bottom of Form

What's New

• • •

We have updated our Terms of Service Branded Reader Desktop Uploader

Sign up to vote on this title
UsefulNot useful