{
  "format": "dataset-manifest/1",
  "slug": "restaurant-orders",
  "version": 1,
  "seed": "restaurant-orders:1",
  "spec": {
    "format": "dataset/1",
    "slug": "restaurant-orders",
    "name": "Restaurant Orders",
    "tagline": "Restaurant chain data including locations, menus, orders, staff, and timestamps of lunch and dinner peaks.",
    "description": "Restaurants operate with complex systems that include locations, menus, orders, and staff management. This dataset models a restaurant chain, capturing essential information about its locations, menu items, tables, staff shifts, and customer orders with line items. Each table in this dataset is designed to provide insights into different aspects of restaurant operations, allowing users to analyze trends in orders, monitor staff performance, and optimize menu offerings. The tables are interrelated, enabling comprehensive queries that can reveal valuable business intelligence. For example, one might explore how different menu items perform during lunch versus dinner peaks, or how staff shifts affect order speed and customer satisfaction. This synthetic dataset provides an ideal foundation for SQL practice and ORM seeding, helping developers simulate real-world scenarios without dealing with sensitive data.",
    "domain": "restaurants",
    "shape": "transactional",
    "useCases": [
      "orm-seeding",
      "sql-practice"
    ],
    "keywords": [
      "restaurant",
      "orders",
      "staff",
      "menu",
      "locations",
      "tables"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "locations": {
        "description": "Each row represents a restaurant location, detailing its name and address. Locations serve as the backbone for orders and staff assignments.",
        "rows": 20,
        "columns": {
          "location_id": {
            "kind": "pk",
            "description": "Unique identifier for the location."
          },
          "name": {
            "kind": "fullName",
            "description": "The name of the restaurant location."
          },
          "address": {
            "kind": "sentence",
            "description": "Full address of the location."
          },
          "city": {
            "kind": "city",
            "description": "City where the location is based."
          },
          "state": {
            "kind": "words",
            "description": "State where the location is based."
          },
          "zip_code": {
            "kind": "postcode",
            "description": "Postal code for the location."
          }
        }
      },
      "menus": {
        "description": "Menus include items available at each location, with details about prices and descriptions, linking back to the location.",
        "rows": 60,
        "columns": {
          "menu_id": {
            "kind": "pk",
            "description": "Unique identifier for the menu item."
          },
          "location_id": {
            "kind": "fk",
            "ref": "locations.location_id",
            "description": "Foreign key linking to the location."
          },
          "item_name": {
            "kind": "productName",
            "description": "Name of the menu item."
          },
          "price": {
            "kind": "decimal",
            "min": 5,
            "max": 50,
            "scale": 2,
            "description": "Price of the menu item."
          },
          "description": {
            "kind": "sentence",
            "description": "A brief description of the menu item."
          }
        }
      },
      "tables": {
        "description": "Represents the tables available in each location, indicating seating capacity and location association.",
        "rows": 40,
        "columns": {
          "table_id": {
            "kind": "pk",
            "description": "Unique identifier for the table."
          },
          "location_id": {
            "kind": "fk",
            "ref": "locations.location_id",
            "description": "Foreign key linking to the location."
          },
          "capacity": {
            "kind": "int",
            "min": 2,
            "max": 10,
            "description": "Number of seats at the table."
          }
        }
      },
      "orders": {
        "description": "Orders capture customer purchases, linking to the table and containing line items for each menu item ordered.",
        "rows": 200,
        "columns": {
          "order_id": {
            "kind": "pk",
            "description": "Unique identifier for the order."
          },
          "table_id": {
            "kind": "fk",
            "ref": "tables.table_id",
            "description": "Foreign key linking to the table."
          },
          "order_time": {
            "kind": "datetime",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "dayProfile": "waking",
            "description": "Timestamp of when the order was placed."
          },
          "customer_id": {
            "kind": "uuid",
            "description": "Unique identifier for the customer."
          }
        }
      },
      "order_line_items": {
        "description": "Line items within an order that detail individual menu items purchased, including their quantities.",
        "rows": 500,
        "columns": {
          "line_item_id": {
            "kind": "pk",
            "description": "Unique identifier for the line item."
          },
          "order_id": {
            "kind": "fk",
            "ref": "orders.order_id",
            "description": "Foreign key linking to the order."
          },
          "menu_id": {
            "kind": "fk",
            "ref": "menus.menu_id",
            "description": "Foreign key linking to the menu item."
          },
          "quantity": {
            "kind": "int",
            "min": 1,
            "max": 10,
            "description": "Number of this item ordered."
          }
        }
      },
      "staff": {
        "description": "Captures staff members working at each location, including their shifts and roles.",
        "rows": 50,
        "columns": {
          "staff_id": {
            "kind": "pk",
            "description": "Unique identifier for the staff member."
          },
          "location_id": {
            "kind": "fk",
            "ref": "locations.location_id",
            "description": "Foreign key linking to the location."
          },
          "name": {
            "kind": "fullName",
            "description": "Full name of the staff member."
          },
          "role": {
            "kind": "enum",
            "values": [
              "server",
              "chef",
              "manager"
            ],
            "description": "Role of the staff member."
          },
          "shift_start": {
            "kind": "datetime",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Start time of the staff member's shift."
          },
          "shift_end": {
            "kind": "datetime",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "End time of the staff member's shift."
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "timestamped",
      "monetary",
      "categorical",
      "nullable"
    ],
    "analysisQuestions": [
      "What are the most popular menu items during lunch and dinner?",
      "How do staff shifts affect order completion times?",
      "Which locations have the highest order volumes?",
      "What is the average order value across different times of day?",
      "How do table capacities relate to order volumes?"
    ],
    "suggestedQueries": [
      {
        "title": "Get all orders with their line items",
        "sql": "SELECT o.order_id, o.order_time, li.quantity, m.item_name FROM orders o JOIN order_line_items li ON o.order_id = li.order_id JOIN menus m ON li.menu_id = m.menu_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count orders by location",
        "sql": "SELECT l.name, COUNT(o.order_id) AS order_count FROM orders o JOIN tables t ON o.table_id = t.table_id JOIN locations l ON t.location_id = l.location_id GROUP BY l.name;",
        "dialect": "postgres"
      },
      {
        "title": "Average order value by time of day",
        "sql": "SELECT EXTRACT(HOUR FROM o.order_time) AS order_hour, AVG(li.quantity * m.price) AS average_order_value FROM orders o JOIN order_line_items li ON o.order_id = li.order_id JOIN menus m ON li.menu_id = m.menu_id GROUP BY order_hour;",
        "dialect": "postgres"
      },
      {
        "title": "Staff performance analysis",
        "sql": "SELECT s.name, COUNT(o.order_id) AS orders_handled FROM staff s JOIN tables t ON s.location_id = t.location_id JOIN orders o ON t.table_id = o.table_id GROUP BY s.name;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Menu Optimization",
        "body": "Restaurant managers can utilize the dataset to identify which menu items are underperforming or highly popular during specific times of day. By analyzing the sales data, they can adjust pricing or remove items to maximize profit and customer satisfaction."
      },
      {
        "title": "Staff Scheduling",
        "body": "Human resources can leverage this dataset to optimize staff scheduling based on peak order times. By analyzing order volume data, they can ensure adequate staffing during busy periods, improving service speed and quality."
      },
      {
        "title": "Location Performance Comparison",
        "body": "Business analysts can compare performance across different locations in the restaurant chain. By analyzing order counts and average order values, they can identify high-performing locations and replicate their successful strategies in others."
      },
      {
        "title": "Customer Behavior Insights",
        "body": "Marketing teams can delve into the dataset to understand customer ordering patterns. By analyzing the relationship between menu items and order times, they can develop targeted promotions and marketing campaigns to drive sales."
      }
    ]
  },
  "counts": {
    "locations": 20,
    "menus": 60,
    "staff": 50,
    "tables": 40,
    "orders": 200,
    "order_line_items": 500
  },
  "stats": {
    "locations": {
      "rows": 20,
      "columns": {
        "location_id": {
          "nulls": 0,
          "distinct": 20,
          "min": 1,
          "max": 20
        },
        "name": {
          "nulls": 0,
          "distinct": 20,
          "min": "Alice Kim",
          "max": "Uma Diaz"
        },
        "address": {
          "nulls": 0,
          "distinct": 20
        },
        "city": {
          "nulls": 0,
          "distinct": 19,
          "min": "Athens",
          "max": "Tokyo"
        },
        "state": {
          "nulls": 0,
          "distinct": 20
        },
        "zip_code": {
          "nulls": 0,
          "distinct": 20,
          "min": 2929,
          "max": 94482
        }
      }
    },
    "menus": {
      "rows": 60,
      "columns": {
        "menu_id": {
          "nulls": 0,
          "distinct": 60,
          "min": 1,
          "max": 60
        },
        "location_id": {
          "nulls": 0,
          "distinct": 18,
          "min": 1,
          "max": 20
        },
        "item_name": {
          "nulls": 0,
          "distinct": 58,
          "min": "Classic Headphones",
          "max": "Wireless Pan"
        },
        "price": {
          "nulls": 0,
          "distinct": 60,
          "min": 5.88,
          "max": 48.97
        },
        "description": {
          "nulls": 0,
          "distinct": 60
        }
      }
    },
    "tables": {
      "rows": 40,
      "columns": {
        "table_id": {
          "nulls": 0,
          "distinct": 40,
          "min": 1,
          "max": 40
        },
        "location_id": {
          "nulls": 0,
          "distinct": 19,
          "min": 1,
          "max": 20
        },
        "capacity": {
          "nulls": 0,
          "distinct": 9,
          "min": 2,
          "max": 10
        }
      }
    },
    "orders": {
      "rows": 200,
      "columns": {
        "order_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "table_id": {
          "nulls": 0,
          "distinct": 39,
          "min": 1,
          "max": 40
        },
        "order_time": {
          "nulls": 0,
          "distinct": 200,
          "min": "2023-01-06 11:30:13",
          "max": "2024-12-25 07:17:51"
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 200
        }
      }
    },
    "order_line_items": {
      "rows": 500,
      "columns": {
        "line_item_id": {
          "nulls": 0,
          "distinct": 500,
          "min": 1,
          "max": 500
        },
        "order_id": {
          "nulls": 0,
          "distinct": 187,
          "min": 1,
          "max": 200
        },
        "menu_id": {
          "nulls": 0,
          "distinct": 60,
          "min": 1,
          "max": 60
        },
        "quantity": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        }
      }
    },
    "staff": {
      "rows": 50,
      "columns": {
        "staff_id": {
          "nulls": 0,
          "distinct": 50,
          "min": 1,
          "max": 50
        },
        "location_id": {
          "nulls": 0,
          "distinct": 18,
          "min": 1,
          "max": 20
        },
        "name": {
          "nulls": 0,
          "distinct": 50,
          "min": "Alice Bennett",
          "max": "Yusuf Novak"
        },
        "role": {
          "nulls": 0,
          "distinct": 3,
          "min": "chef",
          "max": "server"
        },
        "shift_start": {
          "nulls": 0,
          "distinct": 50,
          "min": "2023-01-17 09:41:38",
          "max": "2024-12-31 08:07:31"
        },
        "shift_end": {
          "nulls": 0,
          "distinct": 50,
          "min": "2023-01-07 06:56:25",
          "max": "2024-12-23 10:21:38"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/locations.csv",
      "format": "csv",
      "table": "locations",
      "key": "datasets/restaurant-orders/v1/csv/locations.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/csv/locations.csv",
      "bytes": 2279,
      "sha256": "b0addf4666b52ca0b3c7a5edc81d0ebbd75ce2284e353ba57a70d3f063d7e78a",
      "rows": 20,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/menus.csv",
      "format": "csv",
      "table": "menus",
      "key": "datasets/restaurant-orders/v1/csv/menus.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/csv/menus.csv",
      "bytes": 5071,
      "sha256": "df24724d8777d01bd8fa9ca64488b2bb90ac5185575ff144546274d2c35d7756",
      "rows": 60,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/staff.csv",
      "format": "csv",
      "table": "staff",
      "key": "datasets/restaurant-orders/v1/csv/staff.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/csv/staff.csv",
      "bytes": 3322,
      "sha256": "7d0d86048f2fa764a8ada387174de6ef4adfda4b9f9ce47a97fd8cceeb16e137",
      "rows": 50,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/tables.csv",
      "format": "csv",
      "table": "tables",
      "key": "datasets/restaurant-orders/v1/csv/tables.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/csv/tables.csv",
      "bytes": 367,
      "sha256": "5a53d98504766559c510d422402ee9ab0f28be028b31dd4b11468ac41df914fd",
      "rows": 40,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/orders.csv",
      "format": "csv",
      "table": "orders",
      "key": "datasets/restaurant-orders/v1/csv/orders.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/csv/orders.csv",
      "bytes": 12891,
      "sha256": "25a46ebd2efb076445d062e76fedc04ec0782656032b78ac597572b11a21ed5d",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/order_line_items.csv",
      "format": "csv",
      "table": "order_line_items",
      "key": "datasets/restaurant-orders/v1/csv/order_line_items.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/csv/order_line_items.csv",
      "bytes": 6592,
      "sha256": "9dbb6b58b00adae450922eb24f1e51cb752dbd792f6b130208a9c4c0d5cea890",
      "rows": 500,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "restaurant-orders.json",
      "format": "json",
      "table": null,
      "key": "datasets/restaurant-orders/v1/restaurant-orders.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/restaurant-orders.json",
      "bytes": 113268,
      "sha256": "24275d5b48d1927ef6855894deeafa4f781a4a673e30fe0ff66b25c601d2942a",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/restaurant-orders/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/sql/postgres.sql",
      "bytes": 43601,
      "sha256": "f140d653460c4fa68037dd4a9bb795d62b49e887b08c236217c38b434954da53",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/restaurant-orders/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/sql/mysql.sql",
      "bytes": 42849,
      "sha256": "0a0ee8ec1649971ef7f8ce181fea7093c955e78ebde624d10fd587b093cf38ee",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/restaurant-orders/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/sql/mssql.sql",
      "bytes": 44069,
      "sha256": "c38759cdecad1f93cb184f9b630182dcd37b095b7295c2de44ac48e93cc3ca5d",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/restaurant-orders/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/sql/sqlite.sql",
      "bytes": 42585,
      "sha256": "5f3b2446599a638fe89db76da01c7fbb950214a4171690cfde2f805b9b02652c",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/restaurant-orders/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/prisma/seed.ts",
      "bytes": 92036,
      "sha256": "5e746974498e83dfca8addb66873f5bd95a46d3a79b9b9ead2c441184fc95a12",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/restaurant-orders/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/restaurant-orders/v1/django/fixtures.json",
      "bytes": 142913,
      "sha256": "d6973fddbc882ff68d55002725bc4373a21f8e461fbdfb0d51c902a7e617b2c9",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788734176219,
  "updatedAt": 1788734176219
}
