Barker and IE notation: read a relationship as two sentences
Use customer and order rules to distinguish cardinality, optionality, identifying relationships, and database enforcement.
Barker notation and IE crow's-foot notation both describe cardinality and optionality. The important question is the same in either system: for one parent row, how many child rows are allowed, and for one child row, is a parent required? A circle means optional, a bar means one, and a crow's foot means many in the usual IE reading.
Notation should expose decisions rather than replace them. If a relationship is optional, explain whether a child can exist before a parent is assigned, or whether the application will create the parent in the same transaction. The database constraint, service validation, and ERD should tell the same story.
Start with a customer who has never ordered
Use two explicit rules: a customer may place zero or many orders; an order must belong to exactly one customer. In IE, the orders end shows zero-to-many and the customer end shows exactly one. In Barker, read the relationship half nearest the starting entity for optionality, then the opposite end for maximum cardinality. Relationship names help turn each direction into a sentence.
| Starting row | Allowed related rows | Sentence |
|---|---|---|
| Customer | 0..N orders | A customer may place orders. |
| Order | 1 customer | An order must be placed by one customer. |
Do not reuse the meaning of a dashed line from a different notation. Barker's solid and dashed halves express required and optional participation. Identifier participation is a separate issue; a UID bar identifies a relationship that contributes to the child identifier.
Translate the sentence into database constraints
CREATE TABLE customers (customer_id BIGINT PRIMARY KEY);
CREATE TABLE orders (
order_id BIGINT PRIMARY KEY,
customer_id BIGINT NOT NULL,
FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);Create a customer with no orders: that must succeed. Create an order with an unknown customer: that must fail. Create an order with a NULL customer id: that must also fail. The order id remains the complete order identifier, so this required relationship is non-identifying.
A line cannot enforce every business rule
Changing the requirement to “every customer must have an order” adds a minimum-child-count rule. A foreign key from orders to customers cannot enforce it: the customer can still exist without any child. Enforce the operation as a transaction or through an explicit workflow and decide how imported or abandoned accounts are handled.
Likewise, a one-to-one drawing needs a uniqueness rule on the referencing key in the physical schema. Inspect the actual DDL rather than assuming the symbol creates every constraint. YourERD provides relationship previews; use the child's PK/FK/NN flags and any written uniqueness rules to review the physical meaning.
Reference and next step
Examples use simplified business rules for teaching. Check the database documentation for the exact enforcement behavior of your chosen engine.
- David C. Hay: Barker relationships and unique identifiers
- MySQL: foreign-key constraints
- MySQL: CHECK constraints
- Oracle Data Modeler: modeling concepts and relationship properties
Open the ecommerce sample in YourERD · Explore the sample models