Chapter 6: Entity-Relationship Model Flashcards
What drives everything done in Databases?
The business
Who was the Entity-Relationship Model designed for?
The general public, but it is still as powerful as the relational and RDB models.
What is the purpose of the ER model?
It is supposed to allow a variety of experts to contribute regardless of their technical knowledge about databases.
How can a database be modeled?
A database can be modeled as a collection of entities and a relationship among entities.
What is an entity?
An entity is an object that exists and is distinguishable (avoiding duplicates) from other objects.
What is an entity set?
A set of entities of the same type that share the same properties.
What are attributes?
Essential characteristics that are determined by the business. Entities have attributes.
What is a relationship?
An association among several entities. It is modeled by Keys in a relationship set.
What is a relationship set?
A mathematical relation among at least 2 entities, each taken from entity sets.
What is an attribute?
An attribute is a possible property of a relationship set. Entities are represented by sets of attributes.
What is the degree of a relationship set?
It is the number of entity sets that participate in a relationship set. 2 sets is binary, etc. Relationship sets that are more than binary are rare.
What is the domain of an attribute?
The domain is the set of permitted values (legal values) for each attribute.
How are multiple values handled in RDB?
They are handled by linking tables together, breaking down complex attributes into its atomic subcomponents.
What type of attributes are there?
Atomic (simple) and complex.
What type of attribute must each attribute in an entity set be?
Simple (atomic)
-in RDB this looks like each row in the table being a simple attribute
Who determines if an attribute is simple of composite?
THE BUSINESS
What is the purpose of mapping cardinality constraints?
To express the number of entities to which another entity can be associated via a relationship set.
For a binary relationship what are the types of cardinality mapping that can be done?
- one to one
- one to many
- many to one
- many to many
What is one to one cardinality?
An element in A is mapped directly to a single attribute in B
What is one to many cardinality?
An element in A is mapped to multiple elements in B
What is many to one cardinality?
Many elements in A is mapped to one element in B
What is many to many cardinality?
When many elements in A are mapped to many elements in B
Name the 3 types of keys that exist.
- super key: a set of one or more attributes whose values uniquely determine each entity
- candidate key: the minimal super key
- primary key: a candidate key that is selected to be the main identifier
What is the purpose of keys?
To avoid duplicates and maintain uniqueness within the set.
What are the characteristics of keys?
- unique
- short
- permanent
What is a key?
a set of attribute(s), they are a subset of an attribute