Entity Relationship Diagrams
- 51Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What is an entity–relationship diagram (ERD)?
A visual way to express the logical design of a database.
Or swipe the card
51 cards
What is an entity–relationship diagram (ERD)?
A visual way to express the logical design of a database.
How can you begin turning database requirements into a design?
Identify the nouns in the requirements; they often suggest the kinds of things the database must track.
Why should candidate terms from requirements usually be converted to singular form?
Singular terms name a kind of entity consistently, such as changing “People” to “Person.”
Why might “Owner” be removed from a candidate entity list that already contains “Person”?
Because an owner is a person, “Owner” may be redundant with “Person.”
Why might “Animal” be removed from a pet database’s candidate entity list?
If the requirements only discuss animals that are pets, “Animal” is redundant with “Pet.”
Why should an ambiguous requirement term such as “Type” be clarified?
To specify what kind of type is meant; in a pet database, it can be clarified as “Pet Type.”
What six terms result from refining the pet-database requirements?
Person, Pet, Name, Photo, Pet Type, and Address.
Besides the entities or things themselves, what must a database design capture?
The relationships between those things.
What does cardinality mean in an ERD?
How many instances of one kind of thing can be associated with instances of another kind.
In the pet-ownership model, how many pets may a person own, and how many people may own a pet?
Each person may own zero or more pets, and each pet may be owned by zero or more people.
What is the cardinality between Person and Name in the example model?
Each person has one name, and each name may belong to zero or more people.
What is the cardinality between Pet and Name in the example model?
Each pet has one name, and each name may belong to zero or more pets.
What is the cardinality between Photo and Pet in the example model?
Each photo depicts one pet, and each pet may be depicted in zero or more photos.
What is the cardinality between Pet Type and Pet in the example model?
A pet type may apply to zero or more pets, and each pet has one pet type.
What is the cardinality between Pet and Address in the example model?
Each pet resides at zero or one address, and each address may have zero or more pets.
Why should cardinality decisions have plausible justifications?
Because the decisions determine what situations the database can represent, and incorrect choices can make it fail to meet its requirements.
How does Chen notation represent entities and relationships?
Entities are boxes; relationships are diamonds connected to the relevant entities by lines.
In Chen notation, what does a maximum cardinality of N mean?
Any number; there is no defined upper limit.
In Chen notation, why might the letters N and M be used at opposite ends of a relationship?
Both mean an unlimited number; different letters help avoid implying the two maximum values are equal.
In Chen notation, what does a double line between an entity and a relationship indicate?
The relationship is mandatory for that entity: its minimum participation is one.
In Chen notation, what does a single line between an entity and a relationship indicate?
The relationship is not universal for that entity; its minimum participation can be zero.
In the Chen mother–daughter example, what is the maximum number of mothers per daughter and daughters per mother?
A daughter has a maximum of one mother; a mother has a maximum of N daughters.
In the Chen mother–daughter example, what do the minimum cardinalities imply?
A daughter has at least one mother, while a mother may have zero daughters.
In Chen notation, how are attributes usually drawn?
As ovals connected by lines to the entity they describe.
How does Chen notation indicate that an attribute uniquely identifies an entity?
The identifying attribute is underlined.
How should Chen notation show an identifier made from multiple attributes?
Underline each attribute that forms part of the identifier.
What is a weak entity in Chen notation?
An entity that derives part of its identity from a related entity.
How does Chen notation indicate a weak entity and its identifying relationship?
Use a double border around the weak entity’s box and around its relationship to the identifying entity.
How is an Order Line identified in the example, and why is Line Sequence Number insufficient by itself?
It is identified by Order Number together with Line Sequence Number; the sequence number alone does not uniquely identify it.
Why might Name be modeled as an attribute of Person and Pet rather than as its own entity?
Because each person and each pet has exactly one name, making Name a more natural attribute of each entity.
How does crow’s foot notation show that two entities have a relationship?
By drawing a line between the entities; a relationship diamond is not needed.
In crow’s foot notation, what do the circle, vertical line, and crow’s foot symbols mean?
Circle: zero; vertical line: one; crow’s foot: many.
How are minimum and maximum cardinalities shown at one end of a crow’s foot relationship line?
With two symbols: the first represents the minimum and the second represents the maximum.
How does crow’s foot notation show that each daughter has exactly one mother?
At the daughter end, show a minimum of one and a maximum of one.
How does crow’s foot notation show that each mother may have zero or more daughters?
At the mother end, show a minimum of zero and a maximum of many.
What is a many-to-many relationship?
A relationship in which multiple instances on either side can be associated with multiple instances on the other side.
What is a one-to-many relationship?
A relationship in which one instance on one side can be associated with many instances on the other side.
What is a one-to-one relationship?
A relationship in which each instance on either side is associated with one instance on the other side.
Why should attention focus especially on maximum cardinalities when classifying a relationship?
Maximum cardinalities determine whether the relationship is many-to-many, one-to-many, or one-to-one.
In the pet database, what is the relationship type between Pet and Photo?
One-to-many: each photo depicts one pet, while a pet can appear in zero or more photos.
In the pet database, what are the relationship types between Pet Type and Pet, and between Address and Pet?
Both are one-to-many: a type can apply to many pets, and an address can be associated with many pets.
What does PK mean beside an attribute in a crow’s foot ERD?
Primary key: the attribute is part of the table’s primary key.
What does FK mean beside an attribute in a crow’s foot ERD?
Foreign key: the attribute also appears as a primary key attribute on another entity.
How does an ERD translate into the basic structure of a relational database?
Each entity becomes a table, and each entity attribute becomes a column.
How should primary keys and foreign keys in database tables relate to those in the ERD?
Define the table keys in line with the primary and foreign key attributes shown on the entities.
Which ERD relationship types can ordinarily be represented by foreign key constraints?
One-to-many and one-to-one relationships.
Why can’t a many-to-many relationship be represented directly by an ordinary foreign key constraint between two tables?
A single foreign key in either table does not directly represent multiple associations on both sides.
How can a many-to-many relationship be converted into relationships representable by foreign keys?
Introduce an associative entity between the two entities, turning the relationship into two one-to-many relationships.
What does a PET OWNERSHIP record represent?
One instance of a particular person owning a particular pet.
What relationships connect PERSON and PET to PET OWNERSHIP?
PERSON to PET OWNERSHIP is one-to-many, and PET to PET OWNERSHIP is one-to-many.
How is a many-to-many relationship resolved in the relational database using an associative entity?
Create a table for the associative entity and use foreign key constraints to connect it to each original table.

Ask anything
We've read this whole study set, so questions about it get the best answers.