Objective. Students will convert a completed ERD into a relational schema by applying the standard mapping rules for all relationship types, including resolution of many-to-many relationships into junction tables.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
An entity-relationship diagram (ERD) is a planning tool. A relational schema is the blueprint that a database engine can actually implement. Mapping means translating every entity, attribute, and relationship from your ERD into tables, columns, and keys using a consistent set of rules. Mastering this translation is one of the most tested skills on the DAMA CDMP Associate, Oracle DBA CA, PostgreSQL CE, and Microsoft DP-300 exams.
Every strong (regular) entity in your ERD becomes a table. The entity name becomes the table name. Each single-valued attribute becomes a column. The entity's primary key (PK) attribute becomes the primary key of the table.
Example: An entity Book with attributes `book_id`, `title`, and `publication_year` maps directly to:
```
Book(book_id PK, title, publication_year)
```
Weak entities also become tables, but their primary key is a composite of their own partial key plus the primary key of the identifying (owner) entity, which becomes a foreign key.
In a one-to-many (1:M) relationship, the table on the many side receives a new column: a foreign key (FK) that references the primary key of the one side. No separate relationship table is needed.
Example: One Branch has many Members. The `branch_id` FK is added to the Member table:
```
Branch(branch_id PK, branch_name, address)
Member(member_id PK, full_name, branch_id FK → Branch.branch_id)
```
The foreign key enforces referential integrity — you cannot insert a member with a `branch_id` that does not exist in Branch.
A many-to-many (M:N) relationship cannot be stored directly in either participating table without violating normalization rules. The solution is a junction table (also called an associative table, bridge table, or linking table). The junction table holds at minimum the primary keys of both sides as foreign keys, and those two columns together form the composite primary key of the junction table. Additional attributes that belong to the relationship itself are also placed here.
Example: A Member can borrow many Books, and each Book can be borrowed by many Members. The relationship Loan carries a `loan_date` attribute:
```
Loan(member_id PK/FK → Member.member_id,
book_id PK/FK → Book.book_id,
loan_date)
```
This junction table eliminates the M:N relationship and replaces it with two 1:M relationships.
A one-to-one (1:1) relationship is handled by placing the FK in either table, but it is usually placed in the table that represents the optional or less-frequent participant. A `UNIQUE` constraint on the FK column enforces the one-to-one nature.
If an entity has a multivalued attribute (for example, a Member who may have several phone numbers), that attribute becomes a new table containing the owning entity's PK as a FK, and the attribute itself as a column. The two columns together typically form the composite PK.
```
MemberPhone(member_id PK/FK → Member.member_id,
phone_number PK)
```
When you write up a schema, use the notation your team or exam expects. A widely accepted convention is:
```
table_name(col1 PK, col2, col3 FK → other_table.col_name)
```
Every mapping decision you make has a direct effect on data integrity:
Always cross-check your finished schema against the original ERD. Every relationship arrow in the ERD must appear as a FK or junction table in the schema, and every entity must appear as a table.
In a professional or classroom setting, treat your schema diagram as a controlled document. Date it, name it, and store it alongside the ERD it was derived from. When the ERD changes — and it will — the schema must be updated and both documents kept in sync. This habit is fundamental to database administration practice and is tested conceptually on all four credentials targeted by this program.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.