0% found this document useful (0 votes)
16 views13 pages

Lecture 4 Creating Entity Relationship Diagram ERD (1)

The document provides a comprehensive guide on creating an Entity Relationship Diagram (ERD), outlining the basic format and essential components such as entities, attributes, and relationships. It explains key concepts like primary and foreign keys, cardinality, and relationship participation, along with examples to illustrate the process. Additionally, it presents a sample scenario involving a bookstore to demonstrate the application of ERD principles in database design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views13 pages

Lecture 4 Creating Entity Relationship Diagram ERD (1)

The document provides a comprehensive guide on creating an Entity Relationship Diagram (ERD), outlining the basic format and essential components such as entities, attributes, and relationships. It explains key concepts like primary and foreign keys, cardinality, and relationship participation, along with examples to illustrate the process. Additionally, it presents a sample scenario involving a bookstore to demonstrate the application of ERD principles in database design.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Creating Entity

Relationship Diagram
(ERD)
Basic Format/ Crow’s Foot Format
What are the things to Prepare?
• Scheme and knowing it (scenario or actual problem)
• Pin-pointing the entities
• Describing or identifying the attributes
• Highlighting the Key Attribute
- Primary key
- Foreign key
• Determining the Relationship
Moreover with ERD Concepts
• ERD – represents the conceptual database as viewed by the end user. ERD depicts the databases
main components: entities, attributes and relationships.
• Components of ERD:
• Entities – an object of interest of the end user.
In ERM, it refers to a specific table row as an entity instance or entity
occurrence.
• Attributes – characteristics of the entity.
For example, the STUDENT entity includes the attributes STU_LNAME,
STU_FNAME, and STU_INITIAL.
• Domains – attribute’s set of possible values.
For example, SEX consists of only two possibilities M or F. Others that may
have domain like date, average, grades, etc.
• Identifier keys – uniquely identify each entity instance.
1.Primary key – a candidate key selected as a unique identifier.
2.Foreign key – an attribute (or combination of attributes) in one table whose values match
the primary key in another table or whose values must not be null.
3.Composite Primary key – a primary key composed of more than one attribute
Attributes
• Composite and Simple Attributes
1. Composite Attribute – is an attribute that can be further
subdivided to yield additional attribute.
2. Simple Attribute - is an attribute that cannot be subdivided.
3. Single – valued attribute – is an attribute with a single value.
4. Multivalued Attributes – an attribute that can have several
values.
Relationship
Connectivity and Cardinality
• Cardinality– expresses the minimum and maximum number of entity
occurrences associated with one occurrence of the related entity. In
ERD, cardinality is indicated by placing the appropriate numbers beside
the entities using the format (x,y): x – minimum value and y-for the
maximum value.
• Connectivity – describes the classification of the relationship between
entities: 1:1, 1:M, or M:M.
• Existence Dependence – it can exist in the database only when it is
associated with another entity occurrence. It has a mandatory foreign
key, a foreign key whose values cannot be null.
• Relationship Participation
• Optional Participation (0)
• - Means that one entity occurrences does not require a corresponding entity occurrence
in a particular relationship.
• Mandatory Participation(1)
• - Means that one entity occurrence requires a corresponding entity occurrence in a
particular participation.

• Relationship degree
• -Indicates the number of entities or participants associated with a relationship
• - Unary relationship – exist when a association is maintained within a single entity. Such
a relationship is known as Recursive Relationship.
• - Binary relationship – exist when two entities are associated.
• - Tertiary relationship – exist when three relationships are associated.
• - Higher degree relationship –type of relationship that is more than three entities are
involve.
Sample Scenario:
• Bookstore
- In a bookstore, a store manager
manages everything on its daily process.
A store manager keeps track of
borrowed book, inventory, and sold
books. The manager performs basic to
complex function like computing the
sales and publishing reports.

- So as a database designer, what can be


a projected database that will fit for the
scenario?
Step 1: Pin-pointing the entities
1. Store manager
2. Books
3. Sold Books
4. Inventory
5. Customer
6. Reports
Step 2:Describing or identifying the
attributes
Store manager Books Sold Books Inventory Customer
FirstName Author BookDetails Stock FirstName
MiddleInitial PublishedDate SellDate InventoryDate MiddleInitial
LastName Price TotalPrice BookDetails LastName
Gender Genre Quantity Gender
Age BookName Age

The following are just samples attributes that you can identify.
It is subjective to changed during implementing ERD.
Sample
ERD
Output

The output is not really on its


normal form. We can still
breakdown the authors, publisher,
address, etc. to yields more table.
But as your first ERD, this can
support the schema presented
above.
• Clearly, those
who have
side with PK
will have 1
side, and side
with FK will
have M side.
• The broken line in Crow’s Foot notation signifies that the relationship
is:
Weak (non-identifying) Relationship
- Also known as non-identifying relationship, exist if PK of the related
entity does not contain a PK component of the parent entity. By default,
relationships are established by having the PK of the parent entity appear as a
FK on the related entity.
- It meets the two conditions
1. it is existence dependence
2. it has a primary key that is partially or totally derived from the parent entity in the
relationship.

TAKE NOTE:
• It is not mandatory if you are not using a ERD Tool (e. g. Visio, UML, etc.) to
have Weak Relationship. A straight association line will do.

You might also like