DBMS Chapter4
DBMS Chapter4
Entity
Object of interest to the end user
⁃ Refers to the entity set and not to a single entity
occurrence.
ERM corresponds to a table-not to a row—in the relational
environment
⁃ ERM refers to a table row as an entity instance or entity
occurrence
In Chen, Crow's Foot, and UML notations, an entity is
represented by a rectangle that contains the entity's name.
⁃ The entity name, a noun, is usually written in all capital
letters
Characteristics of entities
Required attribute: must have a value and cannot be left empty
Optional attribute: does not require a value and can be left
empty
Domain: set of possible values for a given attribute
Identifier: one or more attributes that uniquely identify each
entity instance (aka key)
Composite identifier: primary key composed of more than one
attribute (aka composite key)
In ER model, In Crow’s foot model required attributes are
highlighted in bold letters. Where are the normal letters are
optional attributes.
Composite attribute: attribute that can be subdivided to yield
additional attributes
Simple attribute: attribute that cannot be subdivided
Single-valued attribute: attribute that has only a single value
⁃ Is a single-valued attribute always a simple attribute? - No
Multivalued attributes: attributes that have many values
Relationship Strength
Weak (non-identifying) relationship
⁃ Primary key of the related entity does not contain a
primary key component of the parent entity
⁃ Crow's Foot notation with a dashed relationship line
between entities indicate weak relationship between the
entities.
⁃ Conditions of a weak entity
o Existence-dependent
o Has a primary key that is partially or totally derived
from parent entity in the relationship
o It has foreign key.
o Whenever you have strong relationship the child
entity that has foreign key becomes weak entity.
Foreign key cannot be null.
⁃ Database designer determines whether an entity is weak
based on business rules.
⁃ A strong (identifying) relationship indicates that the related
entity is weak. Such a relationship means that both of the
conditions of weak entity have been met for the weak entity
definition
Strong relationships or identifying relationship.
A relationship that occurs when two entities are existence-
dependent; from a database design perspective, this relationship
exists whenever the primary key of the related entity contains
the primary key of the parent entity.
⁃ Primary key of the related entity contains a primary key
component of the parent entity
⁃ Crow's Foot notation with a solid relationship line between
entities represents strong relationship between the entities.
Relationship Participation
Recursive Relationships
Relationship can exist between occurrences of the same
entity
⁃ Naturally, such a condition is found within a unary
relationship
⁃ Common in manufacturing industries
One common pitfall when working with unary relationships is to
confuse participation with referential integrity.
⁃ Similar because they are both implemented through
constraints on the same set of attributes
ER Modeling
Single -valued attribute - An attribute that can have only one value.
Each department may offer many courses, college may have some
department that is classified as research only then it does not offer any
course. The course entity will be Optional to the department.
The relationship of PROFESSOR table to the CLASS table is
Mandatory.
Mandatory (1, N)
Optional (0, N)
Contains only primary key pk – strong entity
Contains pk,fk1 – weak entity
Relationship between strong and weak is strong relationship
Relationship between strong and strong is weak relationship