15
Entity Relationship Diagrams www.myassignmenthelp.net

Entity relationship diagram for dummies

Embed Size (px)

Citation preview

Page 1: Entity relationship diagram for dummies

Entity Relationship

Diagrams

www.myassignmenthelp.net

Page 2: Entity relationship diagram for dummies

Entity-Relationship Diagram

• Entity-Relationship (E-R) Diagram– A detailed or logical representation of the

entities, associations as well as data components to have an organization or maybe small business.

• Notation works by using several key constructs.– Data entities– Relationships– Attributes

www.myassignmenthelp.net

Page 3: Entity relationship diagram for dummies

Entity

• An entity can be a enterprise object which signifies an organization, or even group of data.

• A person, place, object, event or even idea within the user environment about which the business wants in order to maintain data

• Symbolized with a rectangle in E-R diagrams

• Notation:

www.myassignmenthelp.net

Page 4: Entity relationship diagram for dummies

Attribute

• An attribute is a sub-group associated with information within an entity.

• A named property or even attribute of an entity that is associated to an organization

• Notation:

www.myassignmenthelp.net

Page 5: Entity relationship diagram for dummies

ER Diagram Notations

• Week entityRelationship

Multivalued attribute

Key attribute

Strong Weak Relationship

www.myassignmenthelp.net

Page 6: Entity relationship diagram for dummies

Example:

carry

books indexwrote subjectauthors

SS#

name

title

librariesaddress

isbn

Subjectmatter

www.myassignmenthelp.net

Page 7: Entity relationship diagram for dummies

Binary Relationship

The binary relationship between entity set A as well as B may be:

• 1:1 Women marrying Men (function)

• N:1 Children having mothers (function)

marry men

having mothers1n

A B

A B

www.myassignmenthelp.net

Page 8: Entity relationship diagram for dummies

Cont….

• 1:N Mothers having children (inverse function)

• M:N Students enrolled in a class

having childrenn1

A B

enrolled classes A B

www.myassignmenthelp.net

Page 9: Entity relationship diagram for dummies

Key• Identification associated with any kind of data

type.

• The various kinds of KEY attribute are:– Super Key

– Candidate Key – Primary Key– Foreign Key– Composite Key

– Alternate Key

– Secondary Key www.myassignmenthelp.net

Page 10: Entity relationship diagram for dummies

Super Key:

• An attribute as well as combining attribute that is used to identify the records uniquely. A table can have a lot of Super Keys.

– For example:

(ID), (ID,Name), (ID,Address), (ID,Department_ID), (ID,Salary),

The like because any kind of mixture which could determine the actual records uniquely would have been a Super Key.

www.myassignmenthelp.net

Page 11: Entity relationship diagram for dummies

Candidate Key:

• Is a column in a table that is able to be a primary key.– For example:

1) ID

2)Name, address

We have only two Candidate Keys used to determine the actual records from the table uniquely. “ID” Key may determine the actual record uniquely and combined of Name and Address can identify the record uniquely, however nor "Name" neither "Address" may be used to determine the actual "records uniquely“ as it might be possible that we have two employees with similar name or two employees from the same house.

www.myassignmenthelp.net

Page 12: Entity relationship diagram for dummies

Primary Key:

• The attribute or as well as combined attributes that uniquely define the record.

• For example:

Database custom may use among the Candidate Key like Primary Key. In this instance we now have “ID” as well as “Name, Address” as Candidate Key, Consider “ID” Key as a Primary Key as the other key is the combination of more than one attribute.

www.myassignmenthelp.net

Page 13: Entity relationship diagram for dummies

Foreign Key:

• An attribute or combined attribute in a table whose value match a primary key in another table.

Composite Key:

A primary key which includes several attributes is called For example: if we have used “Name, Address” as a

Primary Key then it will be our Composite Key.

www.myassignmenthelp.net

Page 14: Entity relationship diagram for dummies

Alternate Key:

The candidate keys that is not the main primary key is called an alternate key. For example: “Name, Address” as it is the only other

Candidate Key that is not a Primary Key.

Secondary Key:

Alternative associated with primary key. For example: Name, Address, Salary, Department_ID

etc. as they can determine the records but they might not be unique.

www.myassignmenthelp.net

Page 15: Entity relationship diagram for dummies

For getting help with any database related assignments

Contact:http://www.myassignmenthelp.net/databa

se-system-assignment-help.php

www.myassignmenthelp.net