Entities and Relationships

Entities, Attributes, and Relationships

An entity-relationship (ER) model, proposed by Peter Chen in 1976, describes data before any table exists. An entity is a thing you store facts about, an attribute is one such fact, and a relationship connects entities. In the sheet, email, cust_name and country describe a customer, sku, title and authors a book, and status an order, while qty and price describe one book on one order: a relationship with attributes of its own.

Kinds of attributes and where each ends up
Kind Shop example Becomes
Simple price, country One column
Composite a postal address One column per part you query
Derived an order total Computed, or a generated column (Generated Columns)
Multi-valued a book's authors A separate table (First Normal Form)

Something with facts of its own is an entity: a category has a name and a parent. A country code has nothing else the shop stores, so it stays an attribute of the customer.