Chapter 5: Data Modeling with the Entity-Relationship Model
How data model is created
-Interviewing users to get their requirements -being inferred from existing data, forms, reports, and other documents. -Patterns in forms and reports can be used to build data models -Be careful, forms and reports may contain limited data.
Identifiers
-are attributes that name, or identify, entity instances. -the identifier of an entity consists of one or more of the entity's attributes (composite identifier) -identifiers in data models become keys in database designs. -Entities have identifiers, while tables (or relations) have keys.
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.)
Weak entity
Entity whose existence depends upon another entity Example: -ID(entifier)-Dependent weak entity -- identifying relationship. Non-ID(entifier)-dependent weak entity -- non-identifying relationship
Strong entity
Entity whose existence is conceptually independent from other entities. Example: student, staff faculty; table, computer, locker.
Subtypes: Exclusive
If subtypes are exclusive, one super type relates to at most one supertype -- need a discriminator.
Subtypes: Inclusive
If subtypes are inclusive, one super type can relate to one more subtypes.
Data model
Representation of how users view their world
Entity
Something that can be identified and the users want to track. This includes entity class (class) or entity instance (object).
Difference between entities and tables
The difference between an entity (used in data model) and a table (relation) (used in a database design) is that you express a relationship between entities without using foreign keys. This makes it easier to work with entities in the early design process where the very existence of entities and the relationships between them is uncertain.
Entity class (class)
a collection of entities of a given type.
Maximum cardinality
is the maximum number of entity instances that can participate in a relationship instance. (one entity instance (row in one table) can associate with how many of the other entity instances (rows in other tables)
Minimum cardinality
is the minimum number of entity instances that must participate in a relationship instance. (in a logical data model, if an entity instance must participate in a relationship instance, that entity is mandatory in the relationship. Otherwise that entity is optional) (In physical database, each row of the optional table must have a corresponding primary key value of the mandatory table if the two tables are created on a model where the two corresponding entities have mandatory-optional relationship)
Entity instance (object)
the occurrence of a particular entity.