---
title: Build a customers and orders database
project: Tables
version: 7.0
section: recipes
language: it
translation: missing
license: Total.js Enterprise
url: https://totaljs.es/docs/it/tables/7-0/recipes/customers-and-orders/
updated: 2026-11-20T06:39:57.622Z
---

# Build a customers and orders database

> Create two linked tables for customers and their orders, with order numbers and statuses.

This recipe builds a small sales database: a *Customers* table and an *Orders* table where each order belongs to a customer.

## 1. Create the Customers table

**1.** **Options** > **Create table**.

**2.** **Pluralized name** `Customers`, **Singular** `Customer`, **Tab** `Sales`, **Category** `Contacts`.

**3.** Click **Name** in the columns and rename it to `Company`.

**4.** Add the columns:
- `Email`, type **Email**.
- `Phone`, type **Phone**.
- `Country`, type **Dropdown**, with the items `Spain`, `Slovakia` and `Germany`.
- `Active`, type **Checkbox**.

**5.** Click **SUBMIT**.

## 2. Create the Orders table

**1.** **Options** > **Create table**.

**2.** **Pluralized name** `Orders`, **Singular** `Order`, **Tab** `Sales`, **Category** `Orders`.

**3.** Rename **Name** to `Subject`.

**4.** Add the columns:
- `Number`, type **Auto increment**, format `yyyy####`.
- `Customer`, type **Table**, table *Customers*. Check **Required** and **Show link button**, and set **Render items in all related tables** to **As list**.
- `Order date`, type **Date**.
- `Amount`, type **Number**, with **Decimals** `2` and **Format** `{0} EUR`.
- `Status`, type **Dropdown**, with the items `New`, `Paid` and `Shipped`.

**5.** Check **Enable versioning**, so every change of an order is kept.

**6.** Click **SUBMIT**.

## 3. Add data

1. Click **Add** on the *Customers* card and create a few customers.
2. Click **Add** on the *Orders* card, choose a customer and save.

Each order gets the next number, `20260001`, `20260002` and so on. The detail of a customer lists its orders.

## 4. Make it easier to read

- In the **Formatting** tab of *Orders*, add the condition `row.x04 > 1000` with **Bold** to highlight large orders. Use the ID of your Amount column. See [Conditional formatting](../../guides/conditional-formatting/).
- Filter the orders by a customer and save the filter as a [view](../../guides/views/).
