These flashcards aren't stored yet — they'll disappear when you leave. Create a free account to keep them, and unlock everything below.
What is an entity in the ER model?
An entity is a distinguishable real-world object described by attributes (e.g., a person, place, or thing).
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What is an entity set?
An entity set is a group of similar entities, e.g., the table of all students.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
How is a relationship defined in the ER model?
A relationship is a connection between entities, represented as a tuple of their primary keys, e.g., \(\text{advisor}=\{(76766,\ 98988),\dots\}\).
Bekijk hier je kaarten, of sign up to study with spaced repetition.
Can a relationship have descriptive attributes?
Yes. A relationship can carry descriptive attributes, e.g., \(\text{advisor}=\{(76766,\ 98988,\ \text{2023-10-01}),\dots\}\).
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What is the degree of a relationship?
The degree is how many entity sets are involved in the relationship.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
Give an example of a binary and a ternary relationship.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What are the four mapping cardinality types listed?
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What does total participation mean and how is it notated?
Every entity must participate in the relationship; notation: double line ══.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What does partial participation mean and how is it notated?
An entity may participate in the relationship; notation: single line ─.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What shapes represent entity sets, relationships, and attributes in ER diagrams?
Bekijk hier je kaarten, of sign up to study with spaced repetition.
How is a primary key shown in ER diagram notation?
A primary key is shown as an underlined attribute.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What does an arrow (→) and a plain line (─) indicate in ER diagrams?
Arrow (→) indicates the 'to-one' side; plain line (─) indicates the 'many' side.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
In the example, what participation is shown for instructors and students in the advisor relationship?
Instructor has total participation (every instructor advises someone); Student has partial participation (some students have no advisor).
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What does an entity set become when translating an ER diagram to a relational schema?
An entity set becomes a table with the same name, attributes, and primary key.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What does a relationship set become in the relational schema translation?
A relationship set becomes a table containing the primary keys of participating entities, any descriptive attributes, and foreign key constraints.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
How should you choose the primary key for a relationship table in a many-to-many relationship?
Use the combined primary keys of both participating entity tables as the relationship table's primary key.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What primary key is used for a one-to-many relationship table?
Use the key of the many side as the primary key of the relationship table.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
When can you avoid creating a separate relationship table and instead add a foreign key column?
If the relationship is total on one side and to-one on the other, add a foreign key column into the total entity's table instead of a separate table.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
Why must you not use the 'no extra table' trick for partial to-one relationships?
Because partial to-one relationships would create NULL values in the foreign key column since some entities may not participate.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What rule of thumb decides if something should be an attribute or an entity?
If it has its own properties or multiple entities can share it, make it an entity; otherwise use an attribute.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
When should a relationship be modeled as an entity instead of a relationship?
If the interaction can occur more than once between the same pair (duplicates), model it as an entity with its own ID and attributes.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What do these ER shapes represent: rectangle, diamond, text/oval, underline?
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What do the arrow, no-arrow, double line, and single line denote in ER diagrams?
Bekijk hier je kaarten, of sign up to study with spaced repetition.
Give the example of a recursive relationship shown in the notes.
A course can be a prerequisite for another course; the same entity type plays two roles labeled course_id and prereq_id.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What does the ER model map from and to?
The ER model maps real-world entities and relationships into a design and rules to convert that design into relational tables.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
How is an Entity Set translated to a relational schema?
Entity Set → Table (same name, same attrs, same PK)
Bekijk hier je kaarten, of sign up to study with spaced repetition.
How is a Relationship translated to a relational schema?
Relationship → Table (entity PKs + descriptive attrs)
Bekijk hier je kaarten, of sign up to study with spaced repetition.
How should a Many-to-Many relationship be represented in the relational schema?
Many-to-Many → PK = union of both entity PKs
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What is the primary key rule for a One-to-Many translation?
One-to-Many → PK = 'many' side key
Bekijk hier je kaarten, of sign up to study with spaced repetition.
How is a One-to-One relationship translated?
One-to-One → PK = either key, UNIQUE on the other
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What should you do when a relationship is Total and To-One?
Total + To-One → Merge! Add FK column to 'total' entity table
Bekijk hier je kaarten, of sign up to study with spaced repetition.
When should repeating or shared data be modeled as an entity?
If data is repeating or shared → Entity, not attribute
Bekijk hier je kaarten, of sign up to study with spaced repetition.
When should an event be modeled as an entity rather than a relationship?
If an event can happen multiple times → Entity, not relationship
Bekijk hier je kaarten, of sign up to study with spaced repetition.
Name core design elements to track in ER design.
Bekijk hier je kaarten, of sign up to study with spaced repetition.
What is an entity in the ER model?
An entity is a distinguishable real-world object described by attributes (e.g., a person, place, or thing).
What is an entity set?
An entity set is a group of similar entities, e.g., the table of all students.
How is a relationship defined in the ER model?
A relationship is a connection between entities, represented as a tuple of their primary keys, e.g., \(\text{advisor}=\{(76766,\ 98988),\dots\}\).
Can a relationship have descriptive attributes?
Yes. A relationship can carry descriptive attributes, e.g., \(\text{advisor}=\{(76766,\ 98988,\ \text{2023-10-01}),\dots\}\).
What is the degree of a relationship?
The degree is how many entity sets are involved in the relationship.
Give an example of a binary and a ternary relationship.
What are the four mapping cardinality types listed?
What does total participation mean and how is it notated?
Every entity must participate in the relationship; notation: double line ══.
What does partial participation mean and how is it notated?
An entity may participate in the relationship; notation: single line ─.
What shapes represent entity sets, relationships, and attributes in ER diagrams?
How is a primary key shown in ER diagram notation?
A primary key is shown as an underlined attribute.
What does an arrow (→) and a plain line (─) indicate in ER diagrams?
Arrow (→) indicates the 'to-one' side; plain line (─) indicates the 'many' side.
In the example, what participation is shown for instructors and students in the advisor relationship?
Instructor has total participation (every instructor advises someone); Student has partial participation (some students have no advisor).
What does an entity set become when translating an ER diagram to a relational schema?
An entity set becomes a table with the same name, attributes, and primary key.
What does a relationship set become in the relational schema translation?
A relationship set becomes a table containing the primary keys of participating entities, any descriptive attributes, and foreign key constraints.
How should you choose the primary key for a relationship table in a many-to-many relationship?
Use the combined primary keys of both participating entity tables as the relationship table's primary key.
What primary key is used for a one-to-many relationship table?
Use the key of the many side as the primary key of the relationship table.
When can you avoid creating a separate relationship table and instead add a foreign key column?
If the relationship is total on one side and to-one on the other, add a foreign key column into the total entity's table instead of a separate table.
Why must you not use the 'no extra table' trick for partial to-one relationships?
Because partial to-one relationships would create NULL values in the foreign key column since some entities may not participate.
What rule of thumb decides if something should be an attribute or an entity?
If it has its own properties or multiple entities can share it, make it an entity; otherwise use an attribute.
When should a relationship be modeled as an entity instead of a relationship?
If the interaction can occur more than once between the same pair (duplicates), model it as an entity with its own ID and attributes.
What do these ER shapes represent: rectangle, diamond, text/oval, underline?
What do the arrow, no-arrow, double line, and single line denote in ER diagrams?
Give the example of a recursive relationship shown in the notes.
A course can be a prerequisite for another course; the same entity type plays two roles labeled course_id and prereq_id.
What does the ER model map from and to?
The ER model maps real-world entities and relationships into a design and rules to convert that design into relational tables.
How is an Entity Set translated to a relational schema?
Entity Set → Table (same name, same attrs, same PK)
How is a Relationship translated to a relational schema?
Relationship → Table (entity PKs + descriptive attrs)
How should a Many-to-Many relationship be represented in the relational schema?
Many-to-Many → PK = union of both entity PKs
What is the primary key rule for a One-to-Many translation?
One-to-Many → PK = 'many' side key
How is a One-to-One relationship translated?
One-to-One → PK = either key, UNIQUE on the other
What should you do when a relationship is Total and To-One?
Total + To-One → Merge! Add FK column to 'total' entity table
When should repeating or shared data be modeled as an entity?
If data is repeating or shared → Entity, not attribute
When should an event be modeled as an entity rather than a relationship?
If an event can happen multiple times → Entity, not relationship
Name core design elements to track in ER design.
Think of the ER (Entity-Relationship) model as a blueprint for a database: it maps real-world things and their links into a design you can implement as tables.
name, salary, credits.Notation shortcuts often used in diagrams: arrow (→) marks the "to-one" side; no arrow or a crow's foot marks the "many" side.
══.─.instructor).advisor).date).→ = "to-one" (at most one). No arrow = many.══ = total participation.Text diagram example (compact):
instructor ═══════ advisor ───────── student
[ID, name, salary] [ID, name, tot_cred]
(date)
course_id, prereq_id).Example: student(ID, name, tot_cred) with ID as PK.
Relationship sets → Tables or FKs.
Primary key choice depends on cardinality:
Optimization — merge when safe:
advisor table):-- instructor advises exactly one student (total & to-one)
instructor(ID, name, salary, s_id) -- s_id is FK → student(ID)
phone with its own data).If it is a simple, unique property owned by one entity, keep it as an attribute.
Relationship vs Entity:
meeting entity with its own ID and date:meeting(m_id, date) -- m_i → instructor
-- m_s → student
══ = total, ─ = partial.→ = to-one, no arrow = many.advisor(i_id, s_id) -- PK = (i_id, s_id)
i_id → instructor(ID)
s_id → student(ID)
advisor(i_id, s_id) -- PK = s_id
Keep these rules as a checklist while designing: pick entities when data repeats or has structure, pick entities for repeatable events, and follow the PK rules when mapping relationships to tables.
Weet je zeker dat je de volgende 0 flashcard(s) wilt verwijderen? Dit kun je niet ongedaan maken.
Kies tags om te verwijderen uit 0 geselecteerde flashcard(s):
Tags laden...