{
  "dataset_generator": {
    "brief": {
      "business_context": "A specialty coffee roastery that buys green beans from farms, roasts them in batches, and sells bags wholesale to cafes and direct to customers through a subscription.",
      "dialect": "mariadb",
      "dirty_modes": [],
      "field_complexity": "rich",
      "include_dirty_data": false,
      "naming_style": "camelCase",
      "row_scale": "medium",
      "schema_name": "",
      "seed": 7,
      "table_count": [
        7,
        10
      ]
    },
    "business_context": "Hearthstone Coffee Roasters is a specialty coffee roastery that sources green beans directly from farms around the world, roasts them in small batches, and distributes finished coffee to wholesale cafe clients and individual subscribers. The business tracks the full journey from farm origin and green bean inventory through roast batches and finished product SKUs to wholesale orders and recurring customer subscriptions.",
    "defects": [],
    "design": {
      "business_context": "Hearthstone Coffee Roasters is a specialty coffee roastery that sources green beans directly from farms around the world, roasts them in small batches, and distributes finished coffee to wholesale cafe clients and individual subscribers. The business tracks the full journey from farm origin and green bean inventory through roast batches and finished product SKUs to wholesale orders and recurring customer subscriptions.",
      "design_notes": "The schema follows a classic medallion-style flow from sourcing (farms, greenBeans) through production (roastBatches) to products (coffeeProducts) and sales (wholesaleOrders, orderLineItems, subscriptions). A junction table links coffeeProducts to roastBatches to capture the many-to-many reality that one roast batch can yield multiple products and one product recipe can be produced across many batches.",
      "dialect": "mariadb",
      "display_name": "Hearthstone Coffee Roasters",
      "naming_style": "camelCase",
      "schema": "coffeeRoastery",
      "tables": [
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for the farm.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "farmId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Name of the farm or cooperative.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "farmName",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(120)",
              "start": "",
              "type": "company",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Country where the farm is located.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "country",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "country",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Sub-national region or province of the farm.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "region",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "city",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Growing altitude in metres above sea level \u2014 affects cup quality.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 2200.0,
              "minimum": 800.0,
              "name": "altitude",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "int",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Washed",
                "Natural",
                "Honey",
                "Wet-Hulled",
                "Anaerobic"
              ],
              "decimals": 2,
              "description": "Post-harvest processing method most commonly used by this farm.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "processingMethod",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "None",
                "Organic",
                "Fair Trade",
                "Rainforest Alliance",
                "Direct Trade",
                "Organic & Fair Trade"
              ],
              "decimals": 2,
              "description": "Primary certification held by the farm.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "certifications",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Email address for the farm's export contact, if known.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "contactEmail",
              "null_rate": 0.2,
              "nullable": true,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(120)",
              "start": "",
              "type": "email",
              "unique": false,
              "weights": []
            }
          ],
          "description": "One row per coffee-growing farm or cooperative that Hearthstone sources green beans from. Stores origin details used on packaging and in customer-facing descriptions.",
          "is_junction": false,
          "name": "farms",
          "row_count": 12,
          "singular_label": "Farm",
          "size_class": "lookup",
          "unique_together": []
        },
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for the green bean lot.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "greenBeanId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Farm this lot was purchased from.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "farmId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "farms",
              "references_column": "farmId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Human-readable lot identifier printed on storage sacks.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "lotCode",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "GB-@@-####",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(30)",
              "start": "",
              "type": "code",
              "unique": true,
              "weights": []
            },
            {
              "categories": [
                "Bourbon",
                "Typica",
                "Gesha",
                "SL28",
                "Caturra",
                "Catuai",
                "Heirloom"
              ],
              "decimals": 2,
              "description": "Coffee variety or cultivar of this lot.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "variety",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Date Hearthstone received and accepted the lot.",
              "distribution": "recent",
              "end": "2025-06-30",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "purchaseDate",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DATE",
              "start": "2020-01-01",
              "type": "date",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 1,
              "description": "Total weight of the lot purchased in kilograms.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 1500.0,
              "minimum": 60.0,
              "name": "weightKg",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,1)",
              "start": "",
              "type": "decimal",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 1,
              "description": "Kilograms of green beans still in stock \u2014 decremented as batches are roasted.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 1500.0,
              "minimum": 0.0,
              "name": "remainingKg",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,1)",
              "start": "",
              "type": "decimal",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Price paid per kilogram of green beans in USD.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 42.0,
              "minimum": 4.5,
              "name": "costPerKg",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "money",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 1,
              "description": "SCA cupping score (0-100) assigned during quality evaluation; specialty grade is \u226580.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 95.0,
              "minimum": 78.0,
              "name": "cupsScore",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,1)",
              "start": "",
              "type": "decimal",
              "unique": false,
              "weights": []
            }
          ],
          "description": "One row per lot of green (unroasted) coffee beans purchased from a farm. Tracks purchase details, weight, and remaining inventory.",
          "is_junction": false,
          "name": "greenBeans",
          "row_count": 260,
          "singular_label": "Green Bean",
          "size_class": "dimension",
          "unique_together": []
        },
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for the roast batch.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "roastBatchId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Green bean lot consumed in this batch.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "greenBeanId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "greenBeans",
              "references_column": "greenBeanId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Unique batch identifier written on the roaster logbook.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "batchCode",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "RB-####-@@",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(30)",
              "start": "",
              "type": "code",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Date and time the roast session started.",
              "distribution": "seasonal",
              "end": "2025-06-30",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "roastDate",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DATETIME",
              "start": "2020-03-01",
              "type": "datetime",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Weight of green beans loaded into the roaster in kilograms.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 30.0,
              "minimum": 5.0,
              "name": "greenWeightKg",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "decimal",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Weight of finished roasted coffee after moisture loss.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 27.0,
              "minimum": 4.0,
              "name": "roastedWeightKg",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "decimal",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Light",
                "Light-Medium",
                "Medium",
                "Medium-Dark",
                "Dark"
              ],
              "decimals": 2,
              "description": "Roast degree achieved, as assessed by the roaster.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "roastLevel",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 1,
              "description": "Total roast time in minutes from charge to drop.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 18.0,
              "minimum": 8.0,
              "name": "roastDurationMin",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,1)",
              "start": "",
              "type": "decimal",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Free-text tasting and process notes logged by the roastmaster.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "roasterNotes",
              "null_rate": 0.15,
              "nullable": true,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(255)",
              "start": "",
              "type": "sentence",
              "unique": false,
              "weights": []
            }
          ],
          "description": "One row per individual roast session. Each batch consumes a measured quantity of green beans from one lot and produces a finished roasted weight.",
          "is_junction": false,
          "name": "roastBatches",
          "row_count": 1200,
          "singular_label": "Roast Batch",
          "size_class": "fact",
          "unique_together": []
        },
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for the product SKU.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "coffeeProductId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Marketing name of the product, e.g. 'Yirgacheffe Sunrise'.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "productName",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(120)",
              "start": "",
              "type": "text",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Stock-keeping unit code used in warehouse and invoicing systems.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "sku",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "CP-@@@@-##",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(30)",
              "start": "",
              "type": "code",
              "unique": true,
              "weights": []
            },
            {
              "categories": [
                "150",
                "250",
                "500",
                "1000"
              ],
              "decimals": 2,
              "description": "Bag weight in grams \u2014 drives pricing tiers.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "bagSizeGrams",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Whole Bean",
                "Coarse",
                "Medium",
                "Fine",
                "Espresso"
              ],
              "decimals": 2,
              "description": "Grind setting applied (or 'Whole Bean' if unground).",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "grindOption",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Light",
                "Light-Medium",
                "Medium",
                "Medium-Dark",
                "Dark"
              ],
              "decimals": 2,
              "description": "Target roast level for this product.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "roastLevel",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Standard retail price per bag in USD.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 65.0,
              "minimum": 12.0,
              "name": "retailPrice",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "money",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Discounted wholesale price per bag offered to cafe accounts.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 45.0,
              "minimum": 8.0,
              "name": "wholesalePrice",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "money",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Whether this SKU is currently available for ordering.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "isActive",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "TINYINT(1)",
              "start": "",
              "type": "bool",
              "unique": false,
              "weights": []
            }
          ],
          "description": "One row per sellable coffee SKU \u2014 a named product with a defined roast level, grind option, and bag size sold to cafes or subscribers.",
          "is_junction": false,
          "name": "coffeeProducts",
          "row_count": 260,
          "singular_label": "Coffee Product",
          "size_class": "dimension",
          "unique_together": []
        },
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for this batch-to-product assignment.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "batchProductId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "The roast batch that produced this product allocation.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "roastBatchId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "roastBatches",
              "references_column": "roastBatchId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "The product SKU fulfilled by this batch.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "coffeeProductId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "coffeeProducts",
              "references_column": "coffeeProductId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Number of bags of this product filled from the batch.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 500.0,
              "minimum": 10.0,
              "name": "bagsProduced",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "int",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Whether this product allocation passed final quality-control cupping before release for sale.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "qualityPassedQc",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "TINYINT(1)",
              "start": "",
              "type": "bool",
              "unique": false,
              "weights": []
            }
          ],
          "description": "Junction table linking roast batches to the coffee products they produce. One batch can yield multiple products; one product can come from multiple batches.",
          "is_junction": true,
          "name": "batchProducts",
          "row_count": 1200,
          "singular_label": "Batch Product",
          "size_class": "fact",
          "unique_together": [
            [
              "roastBatchId",
              "coffeeProductId"
            ]
          ]
        },
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for the customer.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "customerId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Customer's given name.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "firstName",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(50)",
              "start": "",
              "type": "first_name",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Customer's family name.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "lastName",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(50)",
              "start": "",
              "type": "last_name",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Primary email address used for invoices and communications.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "email",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(120)",
              "start": "",
              "type": "email",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Customer's contact phone number.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "phone",
              "null_rate": 0.1,
              "nullable": true,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(20)",
              "start": "",
              "type": "phone",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Wholesale Cafe",
                "Retail Subscriber",
                "One-Time Retail",
                "Corporate Office"
              ],
              "decimals": 2,
              "description": "Segment the customer belongs to \u2014 drives pricing rules.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "customerType",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "City of the customer's primary delivery address.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "city",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "city",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "State or province of the customer's primary delivery address.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "state",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(2)",
              "start": "",
              "type": "state",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Date the customer first registered with Hearthstone.",
              "distribution": "recent",
              "end": "2025-06-30",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "joinDate",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DATE",
              "start": "2019-06-01",
              "type": "date",
              "unique": false,
              "weights": []
            }
          ],
          "description": "One row per wholesale cafe account or individual direct consumer registered with Hearthstone.",
          "is_junction": false,
          "name": "customers",
          "row_count": 260,
          "singular_label": "Customer",
          "size_class": "dimension",
          "unique_together": []
        },
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for the order.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "wholesaleOrderId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Customer who placed the order.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "customerId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "customers",
              "references_column": "customerId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Calendar date the order was submitted.",
              "distribution": "seasonal",
              "end": "2025-06-30",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "orderDate",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DATE",
              "start": "2020-01-01",
              "type": "date",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Pending",
                "Confirmed",
                "Roasting",
                "Packed",
                "Shipped",
                "Delivered",
                "Cancelled"
              ],
              "decimals": 2,
              "description": "Current fulfilment status of the order.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "status",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Standard Ground",
                "Express 2-Day",
                "Overnight",
                "Local Pickup",
                "Freight"
              ],
              "decimals": 2,
              "description": "Shipping method selected at checkout.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "shippingMethod",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Shipping fee charged to the customer in USD.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 85.0,
              "minimum": 0.0,
              "name": "shippingCost",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "money",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Order-level promotional discount applied as a decimal fraction (e.g. 0.10 = 10%).",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 0.25,
              "minimum": 0.0,
              "name": "discountPercent",
              "null_rate": 0.4,
              "nullable": true,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(5,2)",
              "start": "",
              "type": "percent",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Optional free-text instructions or comments from the customer.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "notes",
              "null_rate": 0.5,
              "nullable": true,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(255)",
              "start": "",
              "type": "sentence",
              "unique": false,
              "weights": []
            }
          ],
          "description": "One row per order placed by a wholesale or retail customer. Header-level order record; individual products are in orderLineItems.",
          "is_junction": false,
          "name": "wholesaleOrders",
          "row_count": 1200,
          "singular_label": "Wholesale Order",
          "size_class": "fact",
          "unique_together": []
        },
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for the line item.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "orderLineItemId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Parent order this line belongs to.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "wholesaleOrderId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "wholesaleOrders",
              "references_column": "wholesaleOrderId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Product SKU ordered on this line.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "coffeeProductId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "coffeeProducts",
              "references_column": "coffeeProductId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Number of bags ordered.",
              "distribution": "pareto",
              "end": "",
              "expression": "",
              "maximum": 120.0,
              "minimum": 1.0,
              "name": "quantity",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "int",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Agreed price per bag at time of order (may differ from current list price).",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 65.0,
              "minimum": 8.0,
              "name": "unitPrice",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "money",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Extended price for this line: quantity \u00d7 unitPrice.",
              "distribution": "uniform",
              "end": "",
              "expression": "quantity * unitPrice",
              "maximum": null,
              "minimum": null,
              "name": "lineTotal",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "computed",
              "unique": false,
              "weights": []
            }
          ],
          "description": "One row per product line within a wholesale order. Stores quantity, agreed unit price, and extended total.",
          "is_junction": false,
          "name": "orderLineItems",
          "row_count": 1200,
          "singular_label": "Order Line Item",
          "size_class": "fact",
          "unique_together": []
        },
        {
          "columns": [
            {
              "categories": [],
              "decimals": 2,
              "description": "Surrogate primary key for the subscription.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "subscriptionId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "pk",
              "unique": true,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Customer who holds this subscription.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "customerId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "customers",
              "references_column": "customerId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Default product SKU shipped on each renewal cycle.",
              "distribution": "zipf",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "coffeeProductId",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "coffeeProducts",
              "references_column": "coffeeProductId",
              "sql_type": "INT",
              "start": "",
              "type": "fk",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Weekly",
                "Bi-Weekly",
                "Monthly",
                "Every 6 Weeks"
              ],
              "decimals": 2,
              "description": "How often a new shipment is triggered.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "frequency",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Number of bags included in each recurring shipment.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 12.0,
              "minimum": 1.0,
              "name": "bagsPerShipment",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "INT",
              "start": "",
              "type": "int",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Locked-in per-bag price for the life of the subscription.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": 55.0,
              "minimum": 10.0,
              "name": "pricePerBag",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "money",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Amount charged to the customer each shipment cycle.",
              "distribution": "uniform",
              "end": "",
              "expression": "bagsPerShipment * pricePerBag",
              "maximum": null,
              "minimum": null,
              "name": "shipmentTotal",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DECIMAL(12,2)",
              "start": "",
              "type": "computed",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Date the subscription first became active.",
              "distribution": "recent",
              "end": "2025-06-30",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "startDate",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DATE",
              "start": "2020-01-01",
              "type": "date",
              "unique": false,
              "weights": []
            },
            {
              "categories": [
                "Active",
                "Paused",
                "Cancelled",
                "Pending Payment"
              ],
              "decimals": 2,
              "description": "Current state of the subscription.",
              "distribution": "uniform",
              "end": "",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "status",
              "null_rate": 0.0,
              "nullable": false,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "VARCHAR(60)",
              "start": "",
              "type": "category",
              "unique": false,
              "weights": []
            },
            {
              "categories": [],
              "decimals": 2,
              "description": "Scheduled date for the next automated shipment; null if paused or cancelled.",
              "distribution": "uniform",
              "end": "2026-06-30",
              "expression": "",
              "maximum": null,
              "minimum": null,
              "name": "nextShipDate",
              "null_rate": 0.2,
              "nullable": true,
              "pattern": "",
              "references": "",
              "references_column": "",
              "sql_type": "DATE",
              "start": "2025-07-01",
              "type": "date",
              "unique": false,
              "weights": []
            }
          ],
          "description": "One row per active or historical subscription agreement where a customer receives recurring coffee deliveries at a set frequency.",
          "is_junction": false,
          "name": "subscriptions",
          "row_count": 260,
          "singular_label": "Subscription",
          "size_class": "dimension",
          "unique_together": []
        }
      ]
    },
    "dialect": "mariadb",
    "display_name": "Hearthstone Coffee Roasters",
    "naming_style": "camelCase",
    "narrative": {
      "column_meanings": {
        "batchProducts.bagsProduced": "The number of bags of this product that were filled from this particular roast batch.",
        "batchProducts.qualityPassedQc": "Whether the bags produced in this batch-product pairing passed Hearthstone's quality inspection and are cleared for sale. Batches that fail QC are not shipped to customers.",
        "coffeeProducts.bagSizeGrams": "The net weight of coffee in each bag, offered in 150, 250, 500, or 1,000-gram sizes.",
        "coffeeProducts.grindOption": "Whether the beans are sold whole or pre-ground, and if ground, to what coarseness. This is set at the product level, so a single roast profile may appear as multiple SKUs for different grind preferences.",
        "coffeeProducts.isActive": "Whether this product is currently being sold. Inactive products remain in the catalog for historical reporting but are not available for new orders.",
        "coffeeProducts.retailPrice": "The per-bag price charged to individual retail buyers.",
        "coffeeProducts.sku": "A short alphanumeric code that uniquely identifies this product in Hearthstone's catalog and on invoices and shipping labels.",
        "coffeeProducts.wholesalePrice": "The per-bag price charged to cafe or other wholesale accounts, which is lower than the retail price to reflect volume purchasing.",
        "customers.customerType": "The business relationship category the customer falls into: a Wholesale Cafe buying in volume, a Retail Subscriber on a recurring plan, a One-Time Retail buyer, or a Corporate Office account.",
        "customers.joinDate": "The date this customer was first registered in Hearthstone's system.",
        "farms.altitude": "The elevation in meters at which the farm's coffee is grown. Higher altitudes are associated with slower bean development and more complex flavors, and this figure often appears in product descriptions.",
        "farms.certifications": "Any third-party ethical or environmental certifications the farm holds, such as Organic or Fair Trade. These are used in marketing and influence which customer segments Hearthstone targets with a given origin.",
        "farms.processingMethod": "How the farm removes the fruit from the coffee cherry after harvest. The method \u2014 Washed, Natural, Honey, Wet-Hulled, or Anaerobic \u2014 significantly influences the flavor profile of the beans and is highlighted in Hearthstone's sourcing notes.",
        "greenBeans.costPerKg": "What Hearthstone paid per kilogram for this lot, used to calculate the raw material cost of any batch roasted from it.",
        "greenBeans.cupsScore": "A professional sensory quality score, typically on a 100-point scale, assigned after the green beans were evaluated by a trained taster. Higher scores indicate more desirable and complex flavor potential.",
        "greenBeans.lotCode": "A unique identifier the farm or Hearthstone assigns to a specific harvest batch. It allows the team to distinguish multiple purchases from the same farm and to trace any finished product back to its exact harvest.",
        "greenBeans.remainingKg": "How many kilograms of this lot have not yet been used in a roast session. This figure decreases each time a roast batch draws from the lot.",
        "greenBeans.variety": "The botanical variety of the coffee plant, such as Gesha or Bourbon. Different varieties have distinct flavor tendencies and command different price points.",
        "greenBeans.weightKg": "The total weight of green beans in this lot at the time of purchase.",
        "orderLineItems.lineTotal": "The total value of this line, calculated as quantity multiplied by unitPrice.",
        "orderLineItems.quantity": "The number of bags of this product included in this line of the order.",
        "orderLineItems.unitPrice": "The per-bag price agreed for this line at the time the order was placed. This may differ from the product's standard wholesale or retail price if a negotiated rate or promotion applied.",
        "roastBatches.batchCode": "A unique reference code assigned to each roast session, used to label finished bags and maintain traceability from product back to roast event.",
        "roastBatches.greenWeightKg": "How many kilograms of green beans were loaded into the roaster for this session. This quantity is deducted from the corresponding lot's remainingKg.",
        "roastBatches.roastDate": "The date and time the roast session was run.",
        "roastBatches.roastDurationMin": "How long the beans were in the roaster, in minutes. Duration interacts with temperature to produce the final roast level and flavor development.",
        "roastBatches.roastedWeightKg": "The weight of finished roasted coffee that came out of the roaster. Roasting always reduces weight through moisture loss, so this figure is always less than greenWeightKg.",
        "roastBatches.roasterNotes": "Free-text observations the roasting technician recorded about the session \u2014 flavor impressions, process adjustments, or anything notable about the batch.",
        "subscriptions.bagsPerShipment": "How many bags the customer receives with each scheduled delivery.",
        "subscriptions.frequency": "How often a shipment goes out under this subscription \u2014 Weekly, Bi-Weekly, Monthly, or Every 6 Weeks.",
        "subscriptions.nextShipDate": "The calendar date on which the next scheduled shipment under this subscription is due to go out.",
        "subscriptions.pricePerBag": "The per-bag rate the subscriber pays, which may differ from the standard retail or wholesale price depending on when and how the subscription was set up.",
        "subscriptions.shipmentTotal": "The total charge for each shipment under this subscription, calculated as bagsPerShipment multiplied by pricePerBag.",
        "subscriptions.startDate": "The date this subscription agreement first went into effect.",
        "subscriptions.status": "The current state of the subscription \u2014 Active means shipments are going out on schedule; Paused means the customer has temporarily stopped deliveries; Cancelled means the agreement has ended; Pending Payment means a billing issue is holding shipments.",
        "wholesaleOrders.discountPercent": "Any percentage discount applied to this order at the header level, typically negotiated for large accounts or promotional purposes.",
        "wholesaleOrders.notes": "Any free-text instructions or comments associated with this order, such as delivery access notes or special packaging requests.",
        "wholesaleOrders.shippingCost": "The freight charge billed to the customer for this order.",
        "wholesaleOrders.shippingMethod": "How Hearthstone is sending the order \u2014 options range from Standard Ground to Overnight or Freight for large wholesale shipments, plus Local Pickup for nearby accounts.",
        "wholesaleOrders.status": "Where this order stands in the fulfillment pipeline, from Pending through Confirmed, Roasting, Packed, Shipped, and finally Delivered."
      },
      "company_story": "Hearthstone Coffee Roasters is a specialty coffee roastery that buys unroasted green beans directly from farms and cooperatives around the world, roasts them in small batches at its facility, and sells the finished coffee under its own branded product line. Its customers fall into two broad groups: wholesale cafe accounts that order in volume, and individual consumers who either subscribe to recurring deliveries or place one-time retail purchases. The business prides itself on traceability \u2014 every bag of coffee can be traced back to the specific farm and lot it came from. The company manages a rotating catalog of roughly 260 active and historical product SKUs across different bag sizes, grind options, and roast levels.",
      "operations": "The journey begins when Hearthstone purchases a lot of green beans from a farm; that lot is logged with its weight, cost, and quality score and held in inventory. When the roasting team is ready, they pull a measured quantity from a lot and run a roast session, recording how much green coffee went in and how much finished roasted coffee came out. The roasted output from one or more sessions is then assigned to specific sellable products \u2014 a 250-gram bag of medium-roast whole bean, for example \u2014 and those bags are counted and cleared through quality control before being available for sale. Wholesale and retail customers then place orders that reference those products, and subscribers receive the same product on a repeating schedule without placing a new order each time.",
      "relationships_prose": "Each green-bean lot is tied to one farm, so every roast batch \u2014 which draws from one lot \u2014 can be traced all the way back to its origin farm and harvest. Roast batches are then linked to the sellable product catalog through the batchProducts table, capturing exactly which bag formats a session produced and whether they cleared quality control. When customers place orders, each order header belongs to one customer and fans out into one or more line items, each referencing a specific product SKU. Subscriptions work similarly \u2014 each subscription belongs to one customer and is pinned to one product SKU, automating the delivery of that product on the agreed schedule without requiring a new order each time.",
      "source": "ai",
      "table_meanings": {
        "batchProducts": "One row per pairing of a roast batch with a coffee product it yielded. Because a single roast session can be packaged into multiple bag formats, and because a given product SKU may be filled from several batches over time, this table records exactly how many bags of a particular product a particular batch produced and whether those bags passed quality inspection.",
        "coffeeProducts": "One row per sellable product SKU in Hearthstone's catalog. A SKU defines a specific combination of product name, bag size, grind option, and roast level, along with the retail and wholesale prices. The isActive flag distinguishes products currently offered from those that have been retired.",
        "customers": "One row per registered customer, whether that is a cafe buying wholesale, an individual with a subscription, a one-time retail buyer, or a corporate office account. The customerType field distinguishes these segments.",
        "farms": "One row per coffee-growing farm or cooperative that Hearthstone has a sourcing relationship with. These are the origin partners whose details appear on packaging and in marketing descriptions \u2014 country, growing region, altitude, and how they process their harvested cherries.",
        "greenBeans": "One row per discrete lot of unroasted beans purchased from a farm. A single farm may supply many lots over time, each with its own lot code, purchase date, bean variety, and professional quality cup score. The lot tracks how many kilograms were purchased and how many remain available for roasting.",
        "orderLineItems": "One row per product line within an order. If a cafe orders three different SKUs in one purchase, that order has three line-item rows, each recording which product, how many bags, and the unit price agreed at the time of sale.",
        "roastBatches": "One row per individual roast session run at the facility. Each session draws from exactly one green-bean lot, records how much green coffee was loaded and how much roasted coffee was produced, and notes the roast level and duration. The roaster can also attach tasting or process notes.",
        "subscriptions": "One row per subscription agreement between Hearthstone and a customer. A subscription locks in a specific coffee product, a delivery frequency, the number of bags per shipment, and the price per bag. It has its own lifecycle \u2014 it can be active, paused, pending payment, or cancelled \u2014 and always carries the date of the next scheduled shipment.",
        "wholesaleOrders": "One row per order placed with Hearthstone. This is the header record \u2014 it captures who ordered, when, how the shipment will travel, any discount applied, and where the order stands in the fulfillment process. The individual products within the order live in orderLineItems."
      }
    },
    "relationships": [
      {
        "cardinality": "1:N",
        "from_column": "farmId",
        "from_table": "greenBeans",
        "optional": false,
        "to_column": "farmId",
        "to_table": "farms"
      },
      {
        "cardinality": "1:N",
        "from_column": "greenBeanId",
        "from_table": "roastBatches",
        "optional": false,
        "to_column": "greenBeanId",
        "to_table": "greenBeans"
      },
      {
        "cardinality": "N:M",
        "from_column": "roastBatchId",
        "from_table": "batchProducts",
        "optional": false,
        "to_column": "roastBatchId",
        "to_table": "roastBatches"
      },
      {
        "cardinality": "N:M",
        "from_column": "coffeeProductId",
        "from_table": "batchProducts",
        "optional": false,
        "to_column": "coffeeProductId",
        "to_table": "coffeeProducts"
      },
      {
        "cardinality": "1:N",
        "from_column": "customerId",
        "from_table": "wholesaleOrders",
        "optional": false,
        "to_column": "customerId",
        "to_table": "customers"
      },
      {
        "cardinality": "1:N",
        "from_column": "wholesaleOrderId",
        "from_table": "orderLineItems",
        "optional": false,
        "to_column": "wholesaleOrderId",
        "to_table": "wholesaleOrders"
      },
      {
        "cardinality": "1:N",
        "from_column": "coffeeProductId",
        "from_table": "orderLineItems",
        "optional": false,
        "to_column": "coffeeProductId",
        "to_table": "coffeeProducts"
      },
      {
        "cardinality": "1:N",
        "from_column": "customerId",
        "from_table": "subscriptions",
        "optional": false,
        "to_column": "customerId",
        "to_table": "customers"
      },
      {
        "cardinality": "1:N",
        "from_column": "coffeeProductId",
        "from_table": "subscriptions",
        "optional": false,
        "to_column": "coffeeProductId",
        "to_table": "coffeeProducts"
      }
    ],
    "version": "1.0.0"
  },
  "name": "coffeeRoastery",
  "schema": "coffeeRoastery",
  "source": "Agoge dataset generator 1.0.0 (seed 7) \u2014 fully synthetic",
  "tables": [
    {
      "approx_rows": 12,
      "columns": [
        {
          "key": "PRI",
          "name": "farmId",
          "type": "int"
        },
        {
          "key": "",
          "name": "farmName",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "country",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "region",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "altitude",
          "type": "int"
        },
        {
          "key": "",
          "name": "processingMethod",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "certifications",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "contactEmail",
          "type": "varchar"
        }
      ],
      "name": "farms"
    },
    {
      "approx_rows": 260,
      "columns": [
        {
          "key": "PRI",
          "name": "greenBeanId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "farmId",
          "type": "int"
        },
        {
          "key": "UNI",
          "name": "lotCode",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "variety",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "purchaseDate",
          "type": "date"
        },
        {
          "key": "",
          "name": "weightKg",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "remainingKg",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "costPerKg",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "cupsScore",
          "type": "decimal"
        }
      ],
      "name": "greenBeans"
    },
    {
      "approx_rows": 1200,
      "columns": [
        {
          "key": "PRI",
          "name": "roastBatchId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "greenBeanId",
          "type": "int"
        },
        {
          "key": "UNI",
          "name": "batchCode",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "roastDate",
          "type": "datetime"
        },
        {
          "key": "",
          "name": "greenWeightKg",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "roastedWeightKg",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "roastLevel",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "roastDurationMin",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "roasterNotes",
          "type": "varchar"
        }
      ],
      "name": "roastBatches"
    },
    {
      "approx_rows": 260,
      "columns": [
        {
          "key": "PRI",
          "name": "coffeeProductId",
          "type": "int"
        },
        {
          "key": "",
          "name": "productName",
          "type": "varchar"
        },
        {
          "key": "UNI",
          "name": "sku",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "bagSizeGrams",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "grindOption",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "roastLevel",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "retailPrice",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "wholesalePrice",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "isActive",
          "type": "tinyint"
        }
      ],
      "name": "coffeeProducts"
    },
    {
      "approx_rows": 1200,
      "columns": [
        {
          "key": "PRI",
          "name": "batchProductId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "roastBatchId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "coffeeProductId",
          "type": "int"
        },
        {
          "key": "",
          "name": "bagsProduced",
          "type": "int"
        },
        {
          "key": "",
          "name": "qualityPassedQc",
          "type": "tinyint"
        }
      ],
      "name": "batchProducts"
    },
    {
      "approx_rows": 260,
      "columns": [
        {
          "key": "PRI",
          "name": "customerId",
          "type": "int"
        },
        {
          "key": "",
          "name": "firstName",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "lastName",
          "type": "varchar"
        },
        {
          "key": "UNI",
          "name": "email",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "phone",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "customerType",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "city",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "state",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "joinDate",
          "type": "date"
        }
      ],
      "name": "customers"
    },
    {
      "approx_rows": 1200,
      "columns": [
        {
          "key": "PRI",
          "name": "wholesaleOrderId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "customerId",
          "type": "int"
        },
        {
          "key": "",
          "name": "orderDate",
          "type": "date"
        },
        {
          "key": "",
          "name": "status",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "shippingMethod",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "shippingCost",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "discountPercent",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "notes",
          "type": "varchar"
        }
      ],
      "name": "wholesaleOrders"
    },
    {
      "approx_rows": 1200,
      "columns": [
        {
          "key": "PRI",
          "name": "orderLineItemId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "wholesaleOrderId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "coffeeProductId",
          "type": "int"
        },
        {
          "key": "",
          "name": "quantity",
          "type": "int"
        },
        {
          "key": "",
          "name": "unitPrice",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "lineTotal",
          "type": "decimal"
        }
      ],
      "name": "orderLineItems"
    },
    {
      "approx_rows": 260,
      "columns": [
        {
          "key": "PRI",
          "name": "subscriptionId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "customerId",
          "type": "int"
        },
        {
          "key": "MUL",
          "name": "coffeeProductId",
          "type": "int"
        },
        {
          "key": "",
          "name": "frequency",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "bagsPerShipment",
          "type": "int"
        },
        {
          "key": "",
          "name": "pricePerBag",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "shipmentTotal",
          "type": "decimal"
        },
        {
          "key": "",
          "name": "startDate",
          "type": "date"
        },
        {
          "key": "",
          "name": "status",
          "type": "varchar"
        },
        {
          "key": "",
          "name": "nextShipDate",
          "type": "date"
        }
      ],
      "name": "subscriptions"
    }
  ]
}