Chapter 05 · Mapping Conceptual Models to Relational Schemas

Mapping Entities and Attributes to Tables and Columns

Translate conceptual entities and attributes into relational tables and columns while preserving identity, domains, nullability, and business semantics.

Beginner55–75 minutesRelational mapping + schema labLast reviewed: August 2026

Learning outcomes

Conceptual and logical models describe domain meaning. A relational schema must turn that meaning into relations, columns, keys, constraints, and references that a DBMS can enforce. The goal is not to copy boxes into tables mechanically; it is to preserve the semantics established in earlier chapters while choosing a precise relational representation.

01

Map strong entity types into relations with primary and alternate keys.

02

Map simple attributes into columns while preserving domain meaning and nullability.

03

Separate conceptual names from implementation-specific column decisions.

04

Build a first relational schema for the WorkshopHub core entities.

The basic mapping rule

For a strong entity type, the standard relational mapping is:

  1. Create one relation for the entity type.
  2. Create a column for each simple stored attribute.
  3. Select a primary key or introduce a surrogate primary key.
  4. Preserve alternate candidate keys with UNIQUE constraints.
  5. Preserve mandatory attributes with NOT NULL.
  6. Express business domains using suitable types, checks, and references.
Mapping principle

A relational table should represent one well-defined row grain. Every non-key column in the table should describe that row's entity instance or relationship instance.

Conceptual entity to relation

Suppose the conceptual model contains:

model · example
Customer  customer_id  legal_name  contact_email  registered_at

A first relational mapping could be:

sql · example
CREATE TABLE customer (    customer_id    INTEGER PRIMARY KEY,    legal_name     TEXT NOT NULL,    contact_email  TEXT,    registered_at  TEXT NOT NULL);

The mapping is straightforward, but the schema is not complete until domain rules are considered. Is contact_email unique? Can it be absent? Is one customer allowed several contacts? What timestamp semantics does registered_at use? Mapping exposes implementation questions that may send you back to requirements.

Choose one row grain

For the customer table, one row should mean exactly one Customer entity instance. This sounds obvious, but many poor schemas mix multiple grains:

model · example
customer_idcustomer_nameasset_serial_numberwork_order_numbertechnician_name

One row now tries to represent Customer, Asset, WorkOrder, and Technician at the same time. Repeating facts and anomalies appear immediately.

Primary keys and alternate keys

Suppose Technician has an internal surrogate and an authoritative employee number:

sql · example
CREATE TABLE technician (    technician_id   INTEGER PRIMARY KEY,    employee_number TEXT NOT NULL UNIQUE,    full_name       TEXT NOT NULL,    active          INTEGER NOT NULL DEFAULT 1);

The surrogate handles internal references; the unique business identifier is not discarded. This preserves both implementation convenience and business semantics.

Map domains, not merely generic types

A logical attribute called quantity_used should not become an unconstrained integer merely because the DBMS supports INTEGER.

model · example
quantity_used INTEGER NOT NULLCHECK (quantity_used > 0)

Similarly, a three-letter currency code can be constrained by length or, preferably, referenced to a governed Currency relation if the domain requires metadata and validation.

Nullability should follow optionality

Map required attributes to NOT NULL when the business rule truly requires the value for every valid row.

Logical attributePossible mappingReason
WorkOrder.opened_atNOT NULLAn opened order must have an opening time.
WorkOrder.closed_atnullableOpen orders have not closed yet.
Asset.serial_numberdependsSome assets may lack or have unreadable serials.
Part.descriptionNOT NULLCatalog entries require a description under the assumed rules.

Do not store derived values automatically

If Customer has a conceptual derived attribute account_age, the relational schema normally stores the source fact:

model · example
registered_at

and derives age when needed. Storing both values creates redundancy unless a deliberate caching/materialization strategy exists.

Logical names versus physical names

A logical model might use:

model · example
Work OrderProblem DescriptionOpened At

The physical schema may adopt a consistent naming convention:

model · example
work_orderproblem_descriptionopened_at

The names differ stylistically but should preserve the same semantics. Maintain traceability between logical attributes and physical columns.

WorkshopHub core tables

sql · example
CREATE TABLE customer (    customer_id    INTEGER PRIMARY KEY,    legal_name     TEXT NOT NULL,    registered_at  TEXT NOT NULL);CREATE TABLE asset (    asset_id         INTEGER PRIMARY KEY,    manufacturer_id  INTEGER,    serial_number    TEXT,    model_name       TEXT,    registered_at    TEXT NOT NULL);CREATE TABLE technician (    technician_id   INTEGER PRIMARY KEY,    employee_number TEXT NOT NULL UNIQUE,    full_name       TEXT NOT NULL);CREATE TABLE part (    part_id       INTEGER PRIMARY KEY,    sku           TEXT NOT NULL UNIQUE,    description   TEXT NOT NULL);

Relationships are intentionally omitted here because Lessons 2 and 3 map them systematically.

Reference entities become relations too

If WorkOrderStatus is a governed reference entity:

sql · example
CREATE TABLE work_order_status (    status_code   TEXT PRIMARY KEY,    display_name  TEXT NOT NULL UNIQUE,    is_terminal   INTEGER NOT NULL DEFAULT 0);

WorkOrder can then reference status_code. If statuses are instead a tiny fixed application enum, a check constraint may be sufficient. The relational mapping follows the conceptual decision.

Weak entities require owner identity

A weak entity such as WorkOrderLine may map to:

sql · example
CREATE TABLE work_order_line (    work_order_id INTEGER NOT NULL,    line_number   INTEGER NOT NULL,    description   TEXT NOT NULL,    PRIMARY KEY (work_order_id, line_number),    FOREIGN KEY (work_order_id)      REFERENCES work_order(work_order_id));

The owner key forms part of the child's key because line number is only unique within a work order.

Mapping should preserve vocabulary

If the conceptual model says Asset, do not rename the physical table object_master without a compelling reason. If the domain says WorkOrderAssignment, avoid reducing it to xref_2. Physical schemas are long-lived documentation.

Practice: map a small entity set

Logical-to-relational exercise

Model these logical entities:

model · example
Warehouse  warehouse_code [candidate key]  name  opened_dateProduct  sku [candidate key]  name  unit_weight  active

Choose primary keys, preserve alternate keys, and propose nullability/domain constraints.

Review one possible answer

You might use warehouse_id and product_id surrogates while keeping warehouse_code and sku unique. Name should be required. opened_date may be nullable if warehouses can be planned before opening. unit_weight should carry a unit or reference a standardized unit domain; active can be required with an explicit default.

Summary and next lesson

Strong entities map naturally to relations, but good mapping preserves row grain, keys, alternate uniqueness, domains, nullability, and semantic names. The next lesson adds one-to-many and one-to-one relationships and shows how foreign-key placement follows cardinality and participation.

References

  • Ramez Elmasri and Shamkant B. Navathe, Fundamentals of Database Systems.
  • C. J. Date, Database Design and Relational Theory.
  • PostgreSQL and SQLite documentation for constraints and referential integrity.

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only assets compatible with the Ethereum/ERC-20 network. Do not send TRC-20/TRON assets.