Vu - Chapter4 ER Model 1 Cont
Vu - Chapter4 ER Model 1 Cont
Vu - Chapter4 ER Model 1 Cont
▪ Design Process
▪ Modeling
▪ Constraints
▪ E-R Diagram
▪ Design Issues
▪ Weak Entity Sets
▪ Extended E-R Features
▪ Design of the Bank Database
▪ Reduction to Relation Schemas
▪ Database Design
▪ UML
Design Phases
▪ binary relationship
✓involve two entity sets (or degree two).
✓most relationship sets in a database system are binary.
▪ Relationships between more than two entity sets are rare. Most
relationships are binary. (More on this later.)
✓Example: students work on research projects under the guidance of an
instructor.
✓relationship proj_guide is a ternary relationship between instructor, student,
and project
Mapping Cardinality Constraints
• Attribute types:
• Simple and composite attributes.
• Single-valued and multivalued attributes
• Example: multivalued attribute: phone_numbers
• Derived attributes
• Can be computed from other attributes
• Example: age, given date_of_birth
• Domain – the set of permitted values for each attribute
Composite Attributes
Redundant Attributes
▪ An alternative way to deal with this redundancy is to not store the attribute
course_id in the section entity and to only store the remaining attributes
section_id, year, and semester. However, the entity set section then does
not have enough attributes to identify a particular section entity uniquely;
although each section entity is distinct, sections for different courses may
share the same section_id, year, and semester.
▪ To deal with this problem, we treat the relationship sec_course as a special
relationship that provides extra information, in this case, the course_id,
required to identify section entities uniquely.
▪ The notion of weak entity set formalizes the above intuition. A weak entity
set is one whose existence is dependent on another entity, called its
identifying entity; instead of associating a primary key with a weak entity,
we use the identifying entity, along with extra attributes called discriminator
to uniquely identify a weak entity. An entity set that is not a weak entity set
is termed a strong entity set.
Weak Entity Sets (Cont.)
▪ Every weak entity must be associated with an identifying entity; that is,
the weak entity set is said to be existence dependent on the identifying
entity set. The identifying entity set is said to own the weak entity set
that it identifies. The relationship associating the weak entity set with the
identifying entity set is called the identifying relationship.
▪ Note that the relational schema we eventually create from the entity set
section does have the attribute course_id, for reasons that will become
clear later, even though we have dropped the attribute course_id from
the entity set section.
Entity Sets
35