RelationalSample

Entity relationship diagram

Entities, their attributes and the rules that connect them, drawn in crow’s-foot notation. The blueprint for a normalised, transactional database.

Try this

  1. 01Pick a sentence in the side panel and find its line: the symbol next to each entity says how many of it the other side can have.
  2. 02Click the line between Customer and Address, then the one between Customer and Order: bar plus crow’s foot versus circle plus crow’s foot. One is mandatory, the other optional.
  3. 03Notice Order line has a two-part key (order_id + line_no): it cannot exist without its order.

Notation

Entity
A thing the business keeps records about (customer, order). Becomes a table.
Primary key (PK)
The column or columns that identify one row.
Foreign key (FK)
A column that points at another entity’s primary key.
Bar ( | )
Exactly one: mandatory participation.
Circle ( o )
Zero: the relationship is optional on that side.
Crow’s foot
Many. Combined with a bar it reads “one or more”, with a circle “zero or more”.

Use it when

  • Designing an operational (OLTP) database
  • Agreeing business rules with stakeholders before building
  • Documenting an existing schema

Avoid it when

  • Designing analytical models for BI (use dimensional modelling)
  • Highly connected data where the relationships are the point (consider a graph)

More in Relational