CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Logistics & Supply Chain

🚚 Logistics & Supply Chain · Database ERD

Logistics Shipment Database Schema

Tables for a logistics system: customers, shipments, packages, consignment legs, hubs, vehicles and tracking events.

More Logistics & Supply Chain templates

Opening a template is free and never counts toward your daily diagrams. Asking the AI to change it counts as one.

Drawing diagram…

What this diagram shows

  • A shipment can travel through several legs and hubs
  • Tracking events are kept per package, not per shipment
  • Proof of delivery is stored with the final event

Prompt used

Logistics database schema: customers create shipments; a shipment has one or more packages; the shipment moves in legs between hubs, each leg assigned to a vehicle; every package has tracking events (picked up, in hub, out for delivery, delivered) with location and time; proof of delivery is attached to the delivery event.

Mermaid code
erDiagram
  CUSTOMER ||--o{ SHIPMENT : books
  SHIPMENT ||--|{ PACKAGE : contains
  SHIPMENT ||--|{ LEG : "moves in"
  HUB ||--o{ LEG : "origin of"
  VEHICLE ||--o{ LEG : carries
  PACKAGE ||--o{ TRACKING_EVENT : logs
  TRACKING_EVENT ||--o| PROOF_OF_DELIVERY : "may have"
  CUSTOMER {
    int id PK
    string name
    string gstin
  }
  SHIPMENT {
    int id PK
    int customer_id FK
    string awb_no
    string service_level
  }
  PACKAGE {
    int id PK
    int shipment_id FK
    decimal weight_kg
    string barcode
  }
  LEG {
    int id PK
    int shipment_id FK
    int from_hub_id FK
    int vehicle_id FK
    datetime departed_at
  }
  HUB {
    int id PK
    string code
    string city
  }
  VEHICLE {
    int id PK
    string registration
    string type
  }
  TRACKING_EVENT {
    int id PK
    int package_id FK
    string status
    datetime at
    string location
  }
  PROOF_OF_DELIVERY {
    int id PK
    int event_id FK
    string receiver_name
    string photo_url
  }

Inside this diagram

An entity relationship diagram with 8 tables, 31 columns and 7 relationships.

Tables and their columns

  • CUSTOMER: id (PK), name, gstin
  • SHIPMENT: id (PK), customer_id (FK), awb_no, service_level
  • PACKAGE: id (PK), shipment_id (FK), weight_kg, barcode
  • LEG: id (PK), shipment_id (FK), from_hub_id (FK), vehicle_id (FK), departed_at
  • HUB: id (PK), code, city
  • VEHICLE: id (PK), registration, type
  • TRACKING_EVENT: id (PK), package_id (FK), status, at, location
  • PROOF_OF_DELIVERY: id (PK), event_id (FK), receiver_name, photo_url

Relationships

  • CUSTOMER books SHIPMENT: each CUSTOMER has zero or more SHIPMENT, each SHIPMENT belongs to exactly one CUSTOMER
  • SHIPMENT contains PACKAGE: each SHIPMENT has one or more PACKAGE, each PACKAGE belongs to exactly one SHIPMENT
  • SHIPMENT moves in LEG: each SHIPMENT has one or more LEG, each LEG belongs to exactly one SHIPMENT
  • HUB origin of LEG: each HUB has zero or more LEG, each LEG belongs to exactly one HUB
  • VEHICLE carries LEG: each VEHICLE has zero or more LEG, each LEG belongs to exactly one VEHICLE
  • PACKAGE logs TRACKING_EVENT: each PACKAGE has zero or more TRACKING_EVENT, each TRACKING_EVENT belongs to exactly one PACKAGE
  • TRACKING_EVENT may have PROOF_OF_DELIVERY: each TRACKING_EVENT has zero or one PROOF_OF_DELIVERY, each PROOF_OF_DELIVERY belongs to exactly one TRACKING_EVENT

Make your own diagram like this

Describe your own system in plain English and the AI ER diagram generator draws it in seconds, in the same style as this template.

Related templates

SequenceLogistics & Supply Chain

Last-Mile Delivery Sequence

From an order leaving the hub to the parcel at the customer's door: rider assignment, live tracking, OTP handover and proof of delivery.

C4 ArchitectureProLogistics & Supply Chain

Shipment Tracking Platform Architecture

A logistics platform that tracks shipments across carriers: booking, scan events from hubs, carrier integrations and customer notifications.

FlowchartLogistics & Supply Chain

Warehouse Inbound Receiving

How a warehouse receives goods: appointment, unloading, checking against the ASN, quality check, putaway and stock update.

Data FlowLogistics & Supply Chain

Fleet Route Optimisation Data Flow

How a delivery company plans daily routes: orders, vehicle capacity, time windows and live traffic feed a route optimiser that assigns stops to drivers.

State MachineLogistics & Supply Chain

Freight Booking Lifecycle

The states of a freight shipment booking, from quote and booking through pickup, transit, customs and delivery.

DeploymentProLogistics & Supply Chain

Cold Chain Monitoring Deployment

Where cold chain monitoring runs for vaccines or fresh food: temperature loggers in reefers and cold rooms, gateways, and a cloud alerting platform.