Week 9 Flashcards
Relationship
Denotes a connection between entity classes.
Should be named with a verb phrase
one phrase - grammar modified to reflect each direction
two phrases - specific for each direction.
relationship instance
denotes a connection between entity instances
Degree
The degree of a relationship is the number of entity classes that participate in the relationship.
Recursive
A relationship among entities of the same type.
Will always have a degree of 1.
Role names are helpful to determine perspective. (mentee, mentor)
Binary
Exactly two entities. Degree of 2.
Maximum Cardinality
the maximum number of entity instances that can occur on one side of a relationship
cardinality ratio: one-to-one, one-to-many or many to one, many to many
if a specific maximum is known you can use the number
Determining maximum cardinality
can entity a have more than one entityb?
can entity b have more than one entity ?
one line for one, crows foot for many
Determining Mimimum cardninality
Does entity_a have to have an entity_B? and vice versa.
If no, than min cardinality is zero. Enoted by an oval placed before the maximum cardinality.
If yes, denoted by a perpendicular line to the relationship, placed before the max cardinality for the entity that is required to participate in the relationship
Supertype/subtype relatinship
IS_A
generalization hierachies
Supertype
A type of entity class that contains attributes that are common accross all specializations
Subtype
a type of entity class that “inherits” attributes of its supertype as well as containing attributes of its own
Strong vs Weak entities
strong – can exist on its own
weak cannot (subtypes). Denoted by rounded corners or double outline
supertype/subtype basic notation
circle with arrows,
subtypes don’t have identifiers
when is a supertype/subtype necessary?
there are attributes that apply to some, but not all, instances of an entity
there is a relationship that pertains to a defined subset of instances of an entity
Completeness Constraint
The minimum number of subtype instances that a supertype instance must belong to.
Must every instance of the supertype belong to a subtype?
§ If an answer is ‘NO, an instance of the supertype doesn’t have to belong to any of the subtype(s)’, then
there is partial specialization.
§ Denoted by a single line from the supertype to the supertype/subtype relationship indicator.
§ If an answer is ‘YES, every instance of the supertype must belong to a subtype’, then there is total
specialization.
§ Denoted by double lines from the supertype to the supertype/subtype relationship indicator.