30
Entity Relationship Model Rahul Khanvani BinaryBuzz.Wordpress.com Presentation on: Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Entity relationship(er) model

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Entity relationship(er) model

Entity Relationship Model

Rahul Khanvani

BinaryBuzz.Wordpress.com

Presentation on:

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 2: Entity relationship(er) model

• The approach of concentrating on database structures constraints during database design we present the model concept of Entity Relationship (ER) Model.

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 3: Entity relationship(er) model

• Frequently used in conceptual design of database applications.

• Diagrammatic notation associated with ER model

is called ER diagrams

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 4: Entity relationship(er) model

1) Requirement collection & analysis

1) Data Requirements.

2) Functional Requirements.

3) User Defined Operations-Transections.

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 5: Entity relationship(er) model

1) Conceptual Schema/Design

1) Include Implementation details.

2) Implementation Of Database

1) Logical Design.

3) Physical Design

1) Internal Storage Structure.

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 6: Entity relationship(er) model

• Entities: ▫ Entities Specifies

Individual Items in an Application

Person

Picture

Thing

Concept

Process Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 7: Entity relationship(er) model

•Relationship: ▫ A relationship is

defined as an association among Entities.

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 8: Entity relationship(er) model

•Attributes: ▫ Each Entity has

specific characteristic that is defined by attribute.

Student Entity has Name

Address

Result as attributes.

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 9: Entity relationship(er) model

• The basic object to the ER Model

• Which is a thing in real world

• It may be an Object With ▫ Physical Existence

Person , Car , House , Employee.

▫ Conceptual Existence

Company , Job , Course. Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 10: Entity relationship(er) model

E-R Diagram

Relationship

Entity

Attributes

• Every Entity has an Attribute- particular Property

To describe It.

• For Example EMPLOYEE Entity Described by Employee’s ▫ Name ,Address

▫ Salary,Job Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 11: Entity relationship(er) model

1. Composite & Single Attributes

2. Single valued & Multi valued Attributes

3. Stored & Derived Attributes

4. Null valued Attributes & Complex Attributes Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 12: Entity relationship(er) model

Composite & Simple Attribute

• Composite Attribute Are Those which can be divided into smaller subparts which represent more attributes with independent meaning. ▫ Employee address divided into street address

,city , state & zip(pin).

• Attributes that are not divisible

are called simple Attributes.

Composite & Simple Attribute

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 13: Entity relationship(er) model

Address

Street

Add

Street no

Apartment name

Apartment no

city pin state

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 14: Entity relationship(er) model

Single Valued & Multi valued Attributes

•An Attribute has a single value for particular entity is called single valued Attribute ▫ Phone no Of employee

▫ Age of employee. Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 15: Entity relationship(er) model

• If an Attribute can have set of values for the same entity is known as Multi-valued Attribute.

• For Example ▫ College Degree

▫ One person may not have degree, another may have one , A third person may have two.

▫ So at that time Attribute Should be Multi-Valued.

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 16: Entity relationship(er) model

Degree

S.S.C

H.S.C

F.Y

S.Y

T.Y Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 17: Entity relationship(er) model

Stored & Derived Attribute

• An attribute which is derivable from another Attribute is called derived attribute. ▫ Age is derived from Birth date.

• Where the derived attributes derivable from the base attribute so the base attribute is stored attribute.

Stored & Derived Attribute

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 18: Entity relationship(er) model

Current Date

Birth date

Age

Stored Attribute

Derived Attribute

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 19: Entity relationship(er) model

• When a particular entity set have any applicable value for an attribute so it considered as null value attribute.

▫ Fax No.

▫ Tele. No.

• Complex Attribute

▫ Complex attributes are nothing but combination of composite and multi value attributes.

Null Value & Complex Attribute

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 20: Entity relationship(er) model

• {Phone(areacode,Phoneno)}

Address_phone

• (Number , • street, • apartment_number)

city , state ,zip))

Address(Street

Address Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 21: Entity relationship(er) model

Entity types & entity Sets

• An entity type defines a collection or set of entities that have same attributes.

• Entity types that do not have key attributes of their own are called weak entity.

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 22: Entity relationship(er) model

Name

Ram

Om

Age

25

37

Salary

20000

30000

Entity Type

Entity

Set

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 23: Entity relationship(er) model

• An important constraint on entity of an entity type in the key or uniqueness constraint.

• Hose values are distinct for each individual entity in entity set.

• Used to identify each entity Uniquely Called Key Attribute. ▫ For Example

Employee Number

Key attributes

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 24: Entity relationship(er) model

Value Sets(Domains) of attributes

• Each Simple attribute of an entity type is associated with the value set which specifies set of values Assigned to the Attributes. ▫ Employee salary-Numeric Value Set

▫ Employee Name-String/Char Value Set

• Value set are not displayed in E-R Diagram

• Specified as Basic data-type Available in most programming language. Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 25: Entity relationship(er) model

• Whenever an attribute one entity type refers to another entity type Is indicates the relation between one entity to another.

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 26: Entity relationship(er) model

• One To One(1:1) :

• One To Many(1:M) :

• Many To Many(M:N)

Relationship Types

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 27: Entity relationship(er) model

• The One To One relationship between entity set indicates that for each entity there in one most entity associated with it.

▫ For example

▫ One department has only one Manager.

One To One Relationship

Manager Department Has

1 1

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 28: Entity relationship(er) model

• The One To Many relationship between entity set indicates that for each entity there is no of entities associated with it.

▫ For example

▫ One employee has No Of employees.

One To Many Relationship

Manager Employee Has

M 1

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 29: Entity relationship(er) model

• The Many To Many relationship between entity set indicates that There is no restrictions Entities have no of entity sets associated with it.

▫ For example

▫ One employee has No Of employees.

Many To Many Relationship

Employee Project Has

N M

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com

Page 30: Entity relationship(er) model

Thank You

Prepared By… Rahul Khanwani..

Rahul Khanvani For More Visit BinaryBuzz.Wordpress.com