Ch 4-5 Flashcards
E-R Model Components
Entities, Attributes, and Relationships
Entities
Refers to the entity set, not an entity occurrence
Entity instance
A row in a table corresponds to it
Rectangle
An entity is represented by it containing the entity’s name
Attributes
Represented by ovals and are connected to the entity with a line
Have a domain-the attribute’s set of possible values
May share a domain
Primary keys are underlined
Simple attribute
Cannot be subdivided
Ex: Age, Sex, and Martial status
Composite Attribute
Can be further subdivided to yield additional attributes
Single-valued attribute
Can have only a single value
Multivalued attribute
Can have many values
Multivalued Attribute in Relational DBMS
Relational DBMS cannot implement multivalued attributes
Derived attribute
Not physically stored within the databases; its value is computed from other attributes
Indicated using a dotted line connecting the attribute with the entity
Relationship
An association between entities
Describes as verbs
Represented by diamond-shaped symbols
Unary Relationship
Exists when an association is maintained within a single entity (Recursive relationship)
Binary Relationship
Exists when two entities are associated (Most common)
Ternary relationship
Three entities participate
Connectivity
Describe the relationship classification
Cardinality
Expresses the specific number of entity occurrences associated with one occurrence of the related entity
Determined by an organization’s business policy
Existence-Dependent
If an entity’s existence depends on the existence of one or more other entities
Dependence
Table can’t exist on its own
Always depend on another entity
Weak Entity
Independence
Table can exist on its own
Strong Entity
Participation
Is optional if one entity occurrence does not require a corresponding entity occurrence in a particular relationship
Optional entity
Shown by small circle on the side of the optional entity
Weak Entity
Existence-dependent on another entity
Has a primary key that is partially or totally derived from its strong counterpart
Indicated by a double rectangle
Strong (Identifying) Relationship
Exists when the PK of the related entity contains a PK component of the parent entity
Crow’s Foot model uses a solid line to connect the two entities
Weak (Non-Identifying) Relationship
Exists when the PK of the related entity does not contain a PK component of the parent entity
Crow’s Foot model uses a dashed line to connect the two entities
Recursive Entity
One in which a relationship can exist between occurrence of the same entity set
Found within a unary relationship
Composite Entity
Often created in the process of replacing a M:N relationship by a pair of 1:M relationships
Serves as a bridge between the relate entities
Composed of the primary keys
May contain additional attributes
Supertype-Subtype (ISA relationship, Generalization-Specialization hierarchy)
Added to the ER model to create the Enhanced ER model
Grouping Entities into types
To avoid NULLs
Allows unique attributes
Subtype Discriminator
Attributes (data field) that determines the subtype (can be boolean or Integer (ID) or String Value (Type/Code)
A subtype entity inherits
the attributes and relationships of the supertype entity and has attributes and relationships unique to itself
A subtype entity is created when
Has some unique attributes that do not apply to the supertype entity
Participates in relationships that do not apply to the supertype entity
Supertype-subtype relationship is modeled as
1:1 relationship in the EER model
Completeness constraint
Specifies whether each entity supertype instance is required to be a member of at least one of the subtype
Total Completeness
That every supertype occurrence must be a member of at least one subtype
Partial Completeness
Some of the supertype instances may not be members of any subtype