CH 5- Data Modeling with the Entity Relationship Modell Flashcards
data model
- plan or blueprint for a database design.
- > is more generalized and abstract than a database design.
• It is easier to change a data model then it is to change
a database design, so it is the appropriate place to work through conceptual database problems
Data Model = Conceptual Design
Design stages
1) Conceptual design (conceptual schema)
2) Logical design (logical schema)
3) Physical design (physical schema)
Entity-Relationship (E-R) model
-set of concepts and graphical symbols that can be used to create conceptual schemas.
Entities
-Something that can be readily identified and that users want to track
a) Entity class—a collection of entities of a given type
b) Entity instance—the occurrence of a particular entity
• There are usually many instances of an entity in an entity class.
Attributes
- describe an entity’s characteristics
- All entity instances of a given entity class have the same attributes, but vary in the values of those attributes.
- They were originally shown in data models as ellipses.
- Data modeling products today commonly show attributes in rectangular form.
Identifiers
- attributes that name, or identify entity instances.
* The identifier of an entity instance consists of one or more of the entity’s attributes.
Composite identifiers
-identifiers that consist of two or more attributes.
• Identifiers in data models become keys in database designs.
– Entities have identifiers.
– Tables (or relations) have keys.
relationships
-relationship class can involve two or more entity classes.
degree of relationship
-Number of entity classes in the relationship
a) binary relationship= two entities (degree 2)
b) Ternary relationship= three entities (degree 3)
Cardinality
- means “count,” and is expressed as a number
a) Maximum cardinality= is the maximum number of relationship instances in which an entity can participate.
b) Minimum cardinality= is the minimum number of relationship instances in which an entity must participate.
Types of maximum cardinality
– One-to-One [1:1]
– One-to-Many [1:N]
– Many-to-Many [N:M]
one-to-many
Parent and Child Entities
– The entity on the one side of the relationship is called
the parent entity or just the parent.
– The entity on the many side of the relationship is
called the child entity or just the child.
Minimum cardinality
• Minimums are generally stated as either zero or one:
– IF zero [0] THEN participation in the relationship by the entity is optional, and no entity instance must
participate in the relationship.
– IF one [1] THEN participation in the relationship by the
entity is mandatory, and at least one entity instance must participate in the relationship.
Strong Entity
-an entity that represents something that can exist on its own.
Examples (PERSON, AUTOMOBILE, BUILDING)
Weak Entity
-an entity whose existence depends on
the presence of another entity.
Example (APARTMENT – depends on BUILDING)