0
0
SQLquery~5 mins

ER diagram to table mapping in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is an ER diagram?
An ER diagram is a visual tool that shows entities (things), their attributes (details), and relationships (connections) between them in a database.
Click to reveal answer
beginner
How do you map an entity from an ER diagram to a table?
Each entity becomes a table. The entity's attributes become columns in that table. The primary key attribute becomes the table's primary key.
Click to reveal answer
intermediate
How are one-to-many relationships represented in tables?
Add a foreign key column in the table on the 'many' side. This foreign key points to the primary key of the 'one' side table.
Click to reveal answer
intermediate
How do you map a many-to-many relationship from an ER diagram?
Create a new table called a junction or associative table. It contains foreign keys referencing the primary keys of the two related tables. These foreign keys together form the composite primary key.
Click to reveal answer
advanced
What happens to weak entities in ER diagram to table mapping?
Weak entities become tables that include their own attributes plus a foreign key referencing the owner entity's primary key. The combination forms the weak entity's primary key.
Click to reveal answer
In ER diagram to table mapping, what does an entity become?
AA table
BA column
CA foreign key
DA relationship
How is a one-to-many relationship represented in tables?
ABy adding a foreign key in the 'many' side table
BBy merging both tables
CBy creating a new table
DBy adding a foreign key in the 'one' side table
What is used to represent a many-to-many relationship in tables?
AA foreign key in one table
BA new junction table
CA primary key in both tables
DNo table needed
What forms the primary key of a weak entity table?
AOnly its own attributes
BOnly the foreign key from owner entity
CCombination of its own attributes and foreign key from owner entity
DNo primary key
Which attribute becomes the primary key in the table mapped from an entity?
AAny attribute
BThe first attribute listed
CThe foreign key
DThe attribute marked as primary key in ER diagram
Explain how to convert a many-to-many relationship from an ER diagram into tables.
Think about how to connect two tables that have many links to each other.
You got /3 concepts.
    Describe the steps to map a weak entity from an ER diagram to a table.
    Weak entities depend on another entity for identification.
    You got /4 concepts.