0% found this document useful (0 votes)
76 views25 pages

Entity Relationship Diagram: Logical Database Design

Entity Relationship Diagram (ERD) modeling is a technique used to represent logical database design. It uses basic units like entities, attributes, and relationships between entities. Entities can be dependent or independent. Attributes describe properties of entities and can be simple, complex, single-valued, multi-valued, stored, derived, or key attributes. Relationships associate entities and can be one-to-one, one-to-many, or many-to-many. ERDs also represent subtypes and supertypes through inheritance relationships. Finally, ERD diagrams translate to relational database tables.

Uploaded by

vijayananthan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views25 pages

Entity Relationship Diagram: Logical Database Design

Entity Relationship Diagram (ERD) modeling is a technique used to represent logical database design. It uses basic units like entities, attributes, and relationships between entities. Entities can be dependent or independent. Attributes describe properties of entities and can be simple, complex, single-valued, multi-valued, stored, derived, or key attributes. Relationships associate entities and can be one-to-one, one-to-many, or many-to-many. ERDs also represent subtypes and supertypes through inheritance relationships. Finally, ERD diagrams translate to relational database tables.

Uploaded by

vijayananthan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

Entity Relationship Diagram

Logical Database Design


Approach

• The E- R modeling technique is the Top -


Down Approach
• Entity relationship modeling is a technique
for analysis and logical modeling of a
system’s data requirements.
• It is the most widely used and has gained
acceptance as the ideal database design.
Basic Units
• Entities
• their attributes
• the relationship that
exists between the
entities
Entities

• An entity is a thing which can be easily


identified. An entity is any object, place,
person, concept or activity about which an
enterprise records data. In the diagramming
technique, entities are named and
represented by a box.
Employee Department
Entity Type

• is a set of things which have the same


properties
• usually denoted in upper case, for example:
EMPLOYEE, STUDENT, DEPARTMENT
Entity Instance

• is a specific individual, thing or object


• usually denoted in lower case or mixed
case. For example: Philosophy, Accounts,
Martin.
Dependent Entity

• An entity whose existence depends on the


existence of another entity
• depicted as double - lined box
• also called as weak entities
Independent Entity

• Existence does not depend on other entities


• depicted in single - lined box
• also called as regular entities
Attributes
• An attribute is the property of a given entity
• An attribute instance is a particular property of
an individual entity instance.
• An attribute type is a property of an entity
type. Eg. City is an attribute type while
Calcutta is an attribute instance
• Attributes are depicted as ellipses, labeled with
the name of the property
NAME ADDRESS
PHONE

EMPCODE

EMPLOYEE
Attributes
• Simple • Complex
• Single Valued • Multi Valued
• Stored • Derived
• Key Attribute
Attributes...

• Complex: An attribute which can be


divided into smaller sub parts, which
represent more basic attributes with
independent meanings of their own. Eg.
Any entity Employee can have an attribute
Address which can further be sub divided
into street, city, country, zip
• Simple: An attribute that is indivisible
Attributes….

• Single Valued: Has a single value for a


particular entity. Eg. The age of entity
Employee
• Multi Valued: An attribute with a set of
values. Eg. The qualifications of any
employee in an organization may vary.
Some may be graduates while others may
be post graduates.
Attributes...

• An attribute whose value is used to


determine the value of another attribute. Eg.
Any Employee’s age can be determined by
the attribute Date of Birth. The age attribute
is then called as the derived attribute and is
said to be derivable from the Date of Birth
attribute, which is called as the stored
attribute.
Attributes….

• Key: An attribute selected as primary key.


They are underlined.
• Derived: An attribute whose value is
determined from the value of a stored
attribute.
Relationships

• Relationship is an association among


entities.
• A relationship is depicted by a diamond,
with the name of the relationship type in it.
• A relation type is an association of entity
types while a relationship instance is an
association of entity instances.
Manages
Types of relationships

• One-to-one
• One-to-many or Many-to-one
• Many-to-many
One-to-one Relationship

• Here the relation FILL relates the two


entities VENDOR and ORDER FORM. It
means that one VENDOR fills only one
ORDER FORM or vice versa
1 1 ORDER
VENDOR FILL FORM
One-to-many Relationship

• Here the two entities VENDOR and ITEM


are related by the relation ORDER. Many
ITEMS can be ordered by one VENDOR or
we can say one VENDOR can order many
items.
1 M
VENDOR ORDER ITEM
Many-to-Many Relationship
• ORDER relates the two entities VENDOR
and ITEM. Many VENDORS can ORDER
many ITEMS.

M M
VENDOR ORDER ITEM
Subtype AND Supertype entities

• A subtype or subentity is a set of another


entity
• A subtype is always dependent on the
supertype for its existence.
• The attributes of the superentity apply to all
the subentities but the converse is not
always true
Sub and super….
• The subtypes are connected to the supertypes
by an unnamed relationship
• The supertype is connected to the
relationship with a line containing a crossbar.
• The supertype is described by the attributes
that are unique to it, which are the attributes
that do not belong to the other subtypes
ADDRESS ECODE
NAME

EMPLOYEE

PERMANENT TEMPORARY

HOURS
ALLOWANCE WORKED
SALARY
DAILY
DEDUCTIONS WAGES
• In the E-R diagram shown in the previous
slide, we have EMPLOYEE as the
SUPERTYPE ENTITY, which has Ecode,
Name and Address as its attributes.
• PERMANENT and TEMPORARY are the
two subsets of EMPLOYEE. So these
subtypes will have one attribute Ecode from
EMPLOYEE while the rest of the attributes
will be unique to each.
Moving from E-R diagrams to
Tables

• A database that conforms to an E-R


diagram can be represented by a collection
of tables in the relational system. Each
property or an attribute in an E-R diagram
maps onto an attribute or column in an
appropriate table

You might also like