Transforming ERDs Into Tables

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

16 Terms

1
New cards

Transforming an ERD

The process of converting entities into tables, attributes into fields, and key attributes into primary keys.

2
New cards

ERD to Table: Entity

Transform each entity into a database table.

3
New cards

ERD to Table: Attribute

Transform each attribute into a field or column.

4
New cards

ERD to Table: Key Attribute

Transform the key attribute into the table's primary key.

5
New cards

Converting a 1:1 Relationship

Merge the two entities into one table. One entity becomes an attribute of the other.

6
New cards

Converting a 1:N Relationship

Add the primary key from the ONE entity as a foreign key in the MANY entity.

7
New cards

Converting a N:M Relationship

Create an intersection table containing the primary keys from both original tables as foreign keys.

8
New cards

Foreign Key Placement in 1:N

The primary key from the ONE side goes into the MANY side as a foreign key.

9
New cards

Intersection Table Step 1

Add an intersection table between the two original tables.

10
New cards

Intersection Table Step 2

Flip the relationship lines so the MANY side faces the intersection table.

11
New cards

Intersection Table Step 3

Add the primary keys from both original tables as foreign key fields in the intersection table.

12
New cards

Intersection Table Step 4

Give the intersection table a name. Example: Registration.

13
New cards

Intersection Table Step 5

Add other relevant fields if necessary. Example: Grade.

14
New cards

Student and Course Example

Students and Courses have a many-to-many relationship, so create a Registration table containing Student ID, Course ID, and Grade.

15
New cards

Student and ID Card Example

Student and ID Card have a one-to-one relationship, so merge the entities into one table.

16
New cards

Student and Library Book Example

Student and Library Book have a one-to-many relationship, so place the Student primary key in the Library Book table as a foreign key.