Semantius Logo

Northwind — Semantic Model

1. Overview

The Northwind sample database models the trading operations of a fictional specialty-foods company. It tracks the products the company buys from suppliers and sells to customers, the orders those customers place, the employees who process the orders, and the shippers who deliver them. Sales territories and regions are also modeled, along with which employees are assigned to which territories.

2. Entity summary

#Table nameSingular labelPurpose
1regionsRegionTop-level sales regions grouping territories.
2categoriesCategoryProduct categorization used across the catalog.
3customersCustomerCompanies that place orders.
4employeesEmployeeStaff who process orders and are assigned to territories.
5suppliersSupplierVendors that provide products.
6productsProductCatalog items sold to customers.
7shippersShipperCarrier companies that deliver orders.
8ordersOrderCustomer purchase orders with shipping details.
9territoriesTerritorySales territories grouped under regions.
10employee_territoriesEmployee TerritoryJunction linking employees to territories (M:N).
11order_detailsOrder DetailLine items within an order (junction linking orders to products).

Entity-relationship diagram

flowchart LR
    employees -->|reports to| employees
    suppliers -->|supplies| products
    categories -->|categorizes| products
    customers -->|places| orders
    employees -->|handles| orders
    shippers -->|ships| orders
    regions -->|contains| territories
    employees --> employee_territories
    territories --> employee_territories
    orders --> order_details
    products --> order_details

3. Entities

3.1 regions — Region

Plural label: Regions Label column: region_description (the human-identifying field; auto-wired by Semantius) Description: Sales territories and geographic regions. Serves as the top-level grouping for territories.

Fields

Field nameFormatRequiredLabelReference / Notes
region_descriptiontextyesRegionlabel_column, searchable

Relationships

  • A regions row may have many territories records (1:N, via territories.region_id).

3.2 categories — Category

Plural label: Categories Label column: category_name Description: Product categories used to group items in the catalog.

Fields

Field nameFormatRequiredLabelReference / Notes
category_nametextyesCategorylabel_column, searchable
descriptiontextyesDescriptionDescription of the product category; searchable

Relationships

  • A categories row may have many products records (1:N, via products.category_id).

3.3 customers — Customer

Plural label: Customers Label column: company_name Description: Customer companies that place orders, with contact and address details.

Fields

Field nameFormatRequiredLabelReference / Notes
company_nametextyesCustomerlabel_column, searchable
customer_idtextyesCustomer IDunique, searchable; short code identifying the customer
contact_nametextyesContact Namesearchable
contact_titletextyesContact TitleJob title of the primary contact
addresstextyesStreet Address
citytextyesCitysearchable
regiontextnoRegionState or province
postal_codetextyesPostal CodePostal or ZIP code
countrytextyesCountrysearchable
phonetextyesPhonePrimary phone number
faxtextnoFax

Relationships

  • A customers row may have many orders records (1:N, via orders.customer_id).

3.4 employees — Employee

Plural label: Employees Label column: last_name Description: Staff records covering personal, contact, and reporting-structure details.

Fields

Field nameFormatRequiredLabelReference / Notes
last_nametextyesEmployeelabel_column, searchable
first_nametextyesFirst Namesearchable
titletextyesTitleJob title
title_of_courtesytextnoTitle of CourtesyCourtesy title (Mr., Ms., Dr., etc.)
birth_datedatenoBirth Date
hire_datedateyesHire Datedefaults to CURRENT_DATE
addresstextyesStreet Address
citytextyesCitysearchable
regiontextnoRegionState or province
postal_codetextyesPostal CodePostal or ZIP code
countrytextyesCountrysearchable
home_phonetextyesHome Phone
extensiontextnoExtensionPhone extension
notestextnoNotes
photo_pathtextnoPhoto Path
reports_toreferencenoReports Toemployees (N:1, restrict); self-ref for reporting hierarchy

Relationships

  • An employees row may have an optional manager that is itself an employees row (N:1 self-reference, via reports_to).
  • An employees row may have many orders records (1:N, via orders.employee_id).
  • employeesterritories is many-to-many through the employee_territories junction table.

3.5 suppliers — Supplier

Plural label: Suppliers Label column: company_name Description: Vendor companies that supply products to the catalog.

Fields

Field nameFormatRequiredLabelReference / Notes
company_nametextyesSupplierlabel_column, searchable
contact_nametextyesContact Namesearchable
contact_titletextyesContact TitleJob title of the primary contact
addresstextyesStreet Address
citytextyesCitysearchable
regiontextnoRegionState or province
postal_codetextyesPostal CodePostal or ZIP code
countrytextyesCountrysearchable
phonetextyesPhonePrimary phone number
faxtextnoFax
homepagetextnoHomepageSupplier website URL

Relationships

  • A suppliers row may have many products records (1:N, via products.supplier_id).

3.6 products — Product

Plural label: Products Label column: product_name Description: Catalog items the company sells, including stock levels, pricing, and supplier/category links.

Fields

Field nameFormatRequiredLabelReference / Notes
product_nametextyesProductlabel_column, searchable
supplier_idreferenceyesSuppliersuppliers (N:1, restrict); supplier providing this product
category_idreferenceyesCategorycategories (N:1, restrict); category this product belongs to
quantity_per_unittextyesQuantity Per UnitQuantity and unit of measure per package
unit_pricefloatyesUnit Pricedefaults to 0.0
units_in_stockint32yesUnits In Stockdefaults to 0; current stock quantity
units_on_orderint32yesUnits On Orderdefaults to 0; quantity currently on order from supplier
reorder_levelint32yesReorder Leveldefaults to 0; minimum stock level before reordering
discontinuedbooleanyesDiscontinueddefaults to FALSE; whether the product is discontinued

Relationships

  • A products row belongs to one suppliers (N:1, required, restrict on delete).
  • A products row belongs to one categories (N:1, required, restrict on delete).
  • productsorders is many-to-many through the order_details junction table.

3.7 shippers — Shipper

Plural label: Shippers Label column: company_name Description: Carrier companies used to deliver orders.

Fields

Field nameFormatRequiredLabelReference / Notes
company_nametextyesShipperlabel_column, searchable
phonetextyesPhone

Relationships

  • A shippers row may have many orders records (1:N, via orders.ship_via).

3.8 orders — Order

Plural label: Orders Label column: ship_name Description: Customer purchase orders, including who placed and handled each one, shipping address, and delivery dates.

Fields

Field nameFormatRequiredLabelReference / Notes
ship_nametextyesOrderlabel_column, searchable
customer_idreferenceyesCustomercustomers (N:1, restrict); customer who placed the order
employee_idreferenceyesEmployeeemployees (N:1, restrict); employee who handled the order
ship_viareferenceyesShipped Viashippers (N:1, restrict); shipper used for this order
ship_addresstextyesShip Address
ship_citytextyesShip Citysearchable
ship_regiontextnoShip RegionState or province for shipment
ship_postal_codetextyesShip Postal Code
ship_countrytextyesShip Countrysearchable
freightfloatyesFreightdefaults to 0.0; freight cost for the order
order_datedateyesOrder Datedefaults to CURRENT_DATE
required_datedateyesRequired Datedefaults to CURRENT_DATE
shipped_datedatenoShipped Date

Relationships

  • An orders row belongs to one customers (N:1, required, restrict on delete).
  • An orders row belongs to one employees (N:1, required, restrict on delete).
  • An orders row belongs to one shippers (N:1, required, restrict on delete).
  • An orders row has many order_details records (1:N, via order_details.order_id).

3.9 territories — Territory

Plural label: Territories Label column: territory_description Description: Sales territories within regions. Each territory belongs to exactly one region and can be assigned to multiple employees.

Fields

Field nameFormatRequiredLabelReference / Notes
territory_descriptiontextyesTerritorylabel_column, searchable
territory_idtextyesTerritory IDunique, searchable; short code identifying the territory
region_idreferenceyesRegionregions (N:1, restrict); region this territory belongs to

Relationships

  • A territories row belongs to one regions (N:1, required, restrict on delete).
  • territoriesemployees is many-to-many through the employee_territories junction table.

3.10 employee_territories — Employee Territory

Plural label: Employee Territories Label column: label (auto-generated generic label; no domain-level identifier on this junction) Description: Links employees to the territories they have been assigned to. Pure M:N junction.

Fields

Field nameFormatRequiredLabelReference / Notes
employee_idparentyesEmployeeemployees (N:1, restrict); reference to the employee
territory_idparentyesTerritoryterritories (N:1, restrict); reference to the territory

Relationships

  • A junction row belongs to one employees and one territories (both parent FKs, required). Together these represent the M:N relationship between employees and territories.

3.11 order_details — Order Detail

Plural label: Order Details Label column: label (auto-generated generic label; no domain-level identifier on this junction) Description: Line items within an order — which product was ordered, at what price, quantity, and discount. Junction between orders and products with additional line-level attributes.

Fields

Field nameFormatRequiredLabelReference / Notes
order_idparentyesOrderorders (N:1, restrict); reference to the order
product_idparentyesProductproducts (N:1, restrict); reference to the product
unit_pricefloatyesUnit Pricedefaults to 0.0; actual price per unit charged on this order
quantityint32yesQuantitydefaults to 0; number of units ordered
discountfloatyesDiscountdefaults to 0.0; discount rate applied to this line item

Relationships

  • An order_details row belongs to one orders (N:1, required, restrict on delete).
  • An order_details row belongs to one products (N:1, required, restrict on delete).
  • Together, the pair of parent FKs models the M:N relationship between orders and products, enriched with line-level pricing data.

4. Relationship summary

FromFieldToCardinalityKindDelete behavior
employeesreports_toemployeesN:1reference (self)restrict
productssupplier_idsuppliersN:1referencerestrict
productscategory_idcategoriesN:1referencerestrict
orderscustomer_idcustomersN:1referencerestrict
ordersemployee_idemployeesN:1referencerestrict
ordersship_viashippersN:1referencerestrict
territoriesregion_idregionsN:1referencerestrict
employee_territoriesemployee_idemployeesN:1parent (junction)restrict
employee_territoriesterritory_idterritoriesN:1parent (junction)restrict
order_detailsorder_idordersN:1parent (junction)restrict
order_detailsproduct_idproductsN:1parent (junction)restrict

5. Enumerations

No enumerations defined.

6. Open questions

6.1 🔴 Decisions needed (blockers)

None.

6.2 🟡 Future considerations (deferred scope)

None.

7. Implementation notes for the downstream agent

  1. Create one module named nwind and two baseline permissions (nwind:read, nwind:manage) before any entity. The live module currently uses nwind:view / nwind:manage — align naming with the deployer’s convention or keep the live names, but be explicit at deploy time.
  2. Create entities in the order given in §2 — entities referenced by others first. Creation order that satisfies FK dependencies: regions, categories, customers, suppliers, shippers, employees (then a second pass for employees.reports_to self-reference), products, territories, orders, employee_territories, order_details.
  3. For each entity: set label_column to the snake_case field marked as label_column in §3, pass module_id, view_permission, edit_permission. Do not manually create id, created_at, updated_at, or the auto-label field. For employee_territories and order_details, label_column defaults to label (the generic auto-label) — no dedicated label field is defined on the junction.
  4. For each field in §3: pass table_name, field_name, format, title (the Label column), is_nullable (inverse of Required), and for reference/parent fields also reference_table and the reference_delete_mode consistent with §4 (all currently restrict).
  5. Deduplicate against Semantius built-in tables. This model is self-contained and does not currently reference any Semantius built-in (e.g. users). All FK targets are nwind entities — no deduplication required.
  6. After creation, spot-check that label_column on each entity resolves to a real field and that all reference_table targets exist.

External / built-in entities referenced: None. Every reference_table target resolves to an entity declared above.

Self-references: employees.reports_toemployees. Create the field in a second pass after employees exists.

Junctions (create last): employee_territories (parents: employees, territories), order_details (parents: orders, products, plus line-level scalar fields).