{
  "format": "dataset-manifest/1",
  "slug": "bill-of-materials",
  "version": 1,
  "seed": "bill-of-materials:1",
  "spec": {
    "format": "dataset/1",
    "slug": "bill-of-materials",
    "name": "Bill of Materials",
    "tagline": "Modeling product assembly from sub-assemblies to parts.",
    "description": "Manufacturers create complex products through a structured process of assembly. This dataset models the hierarchical relationship between products, sub-assemblies, and individual parts, all of which are essential for understanding how to assemble a final product. Each product can consist of multiple sub-assemblies, and each sub-assembly can further include various parts, providing a clear representation of the bill of materials tree. This dataset is particularly useful for those looking to practice SQL queries involving hierarchical data structures, as it allows users to explore relationships and quantities at each level of assembly. The tables include information about the quantities required for each component at different levels and the suppliers for the individual parts, offering insights into inventory and procurement processes. It is important to note that this dataset is synthetic, designed specifically for educational and practice purposes in the manufacturing domain.",
    "domain": "manufacturing",
    "shape": "hierarchical",
    "useCases": [
      "sql-practice",
      "teaching"
    ],
    "keywords": [
      "bill of materials",
      "manufacturing",
      "assembly",
      "products",
      "sub-assemblies",
      "parts",
      "suppliers"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "products": {
        "description": "This table contains the main products that are assembled, each linked to its sub-assemblies.",
        "rows": 200,
        "columns": {
          "product_id": {
            "kind": "pk",
            "description": "Unique identifier for each product."
          },
          "product_name": {
            "kind": "fullName",
            "description": "Name of the product."
          },
          "description": {
            "kind": "sentence",
            "description": "Description of the product.",
            "nullable": true
          }
        }
      },
      "sub_assemblies": {
        "description": "This table lists sub-assemblies that comprise the products, linking back to the products table.",
        "rows": 400,
        "columns": {
          "sub_assembly_id": {
            "kind": "pk",
            "description": "Unique identifier for each sub-assembly."
          },
          "product_id": {
            "kind": "fk",
            "ref": "products.product_id",
            "description": "Reference to the product this sub-assembly belongs to."
          },
          "sub_assembly_name": {
            "kind": "fullName",
            "description": "Name of the sub-assembly."
          },
          "quantity": {
            "kind": "int",
            "min": 1,
            "max": 10,
            "description": "Quantity of this sub-assembly required for the product.",
            "nullable": true
          }
        }
      },
      "parts": {
        "description": "This table includes individual parts that make up the sub-assemblies, linked to the respective sub-assemblies.",
        "rows": 600,
        "columns": {
          "part_id": {
            "kind": "pk",
            "description": "Unique identifier for each part."
          },
          "sub_assembly_id": {
            "kind": "fk",
            "ref": "sub_assemblies.sub_assembly_id",
            "description": "Reference to the sub-assembly this part belongs to."
          },
          "part_name": {
            "kind": "fullName",
            "description": "Name of the part."
          },
          "quantity": {
            "kind": "int",
            "min": 1,
            "max": 100,
            "description": "Quantity of this part required for the sub-assembly.",
            "nullable": true
          }
        }
      },
      "suppliers": {
        "description": "This table lists suppliers for the individual parts, providing information on where to procure them.",
        "rows": 150,
        "columns": {
          "supplier_id": {
            "kind": "pk",
            "description": "Unique identifier for each supplier."
          },
          "part_id": {
            "kind": "fk",
            "ref": "parts.part_id",
            "description": "Reference to the part that this supplier provides."
          },
          "supplier_name": {
            "kind": "company",
            "description": "Name of the supplier company."
          },
          "contact_info": {
            "kind": "words",
            "description": "Contact information for the supplier.",
            "nullable": true
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "nullable",
      "categorical",
      "high-cardinality"
    ],
    "analysisQuestions": [
      "What is the total quantity of each part required for final products?",
      "Which sub-assemblies comprise the most complex products?",
      "How many unique suppliers are available for each part?",
      "What are the potential inventory requirements for certain products?"
    ],
    "suggestedQueries": [
      {
        "title": "List all products and their sub-assemblies",
        "sql": "SELECT p.product_name, sa.sub_assembly_name FROM products p JOIN sub_assemblies sa ON p.product_id = sa.product_id;",
        "dialect": "postgres"
      },
      {
        "title": "Calculate total parts required for each sub-assembly",
        "sql": "SELECT sa.sub_assembly_name, SUM(p.quantity) as total_parts FROM sub_assemblies sa JOIN parts p ON sa.sub_assembly_id = p.sub_assembly_id GROUP BY sa.sub_assembly_name;",
        "dialect": "postgres"
      },
      {
        "title": "Find suppliers for specific parts",
        "sql": "SELECT p.part_name, s.supplier_name FROM parts p JOIN suppliers s ON p.part_id = s.part_id;",
        "dialect": "postgres"
      },
      {
        "title": "Count parts per product",
        "sql": "SELECT p.product_name, COUNT(pa.part_id) as part_count FROM products p JOIN sub_assemblies sa ON p.product_id = sa.product_id JOIN parts pa ON sa.sub_assembly_id = pa.sub_assembly_id GROUP BY p.product_name;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Educational SQL Practice",
        "body": "Students learning SQL can use this dataset to practice writing complex queries that involve joins, aggregations, and hierarchical structures. They can explore how products are built from sub-assemblies and parts while learning to navigate relational databases."
      },
      {
        "title": "Supply Chain Analysis",
        "body": "Supply chain managers can analyze the dataset to understand parts requirements for various products and identify potential suppliers for each component. This analysis helps in planning and optimizing inventory management."
      },
      {
        "title": "Manufacturing Simulation",
        "body": "Manufacturing engineers can utilize this dataset to simulate the assembly process of products, ensuring that all necessary components are accounted for. They can also evaluate the impact of changes in supplier availability on production timelines."
      },
      {
        "title": "Cost Estimation and Budgeting",
        "body": "Financial analysts can use this dataset to estimate costs associated with each product assembly based on the parts required and their respective suppliers. This helps in budgeting and forecasting expenses in the manufacturing process."
      }
    ]
  },
  "counts": {
    "products": 200,
    "sub_assemblies": 400,
    "parts": 600,
    "suppliers": 150
  },
  "stats": {
    "products": {
      "rows": 200,
      "columns": {
        "product_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "product_name": {
          "nulls": 0,
          "distinct": 199,
          "min": "Alice Ali",
          "max": "Zoe Vargas"
        },
        "description": {
          "nulls": 21,
          "distinct": 177
        }
      }
    },
    "sub_assemblies": {
      "rows": 400,
      "columns": {
        "sub_assembly_id": {
          "nulls": 0,
          "distinct": 400,
          "min": 1,
          "max": 400
        },
        "product_id": {
          "nulls": 0,
          "distinct": 182,
          "min": 1,
          "max": 200
        },
        "sub_assembly_name": {
          "nulls": 0,
          "distinct": 390,
          "min": "Alice Brown",
          "max": "Zoe Mendes"
        },
        "quantity": {
          "nulls": 44,
          "distinct": 10,
          "min": 1,
          "max": 10
        }
      }
    },
    "parts": {
      "rows": 600,
      "columns": {
        "part_id": {
          "nulls": 0,
          "distinct": 600,
          "min": 1,
          "max": 600
        },
        "sub_assembly_id": {
          "nulls": 0,
          "distinct": 303,
          "min": 1,
          "max": 400
        },
        "part_name": {
          "nulls": 0,
          "distinct": 574,
          "min": "Alice Hughes",
          "max": "Zoe Martin"
        },
        "quantity": {
          "nulls": 57,
          "distinct": 99,
          "min": 1,
          "max": 100
        }
      }
    },
    "suppliers": {
      "rows": 150,
      "columns": {
        "supplier_id": {
          "nulls": 0,
          "distinct": 150,
          "min": 1,
          "max": 150
        },
        "part_id": {
          "nulls": 0,
          "distinct": 128,
          "min": 2,
          "max": 599
        },
        "supplier_name": {
          "nulls": 0,
          "distinct": 126,
          "min": "Acme Digital",
          "max": "Willow Partners"
        },
        "contact_info": {
          "nulls": 16,
          "distinct": 134
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/products.csv",
      "format": "csv",
      "table": "products",
      "key": "datasets/bill-of-materials/v1/csv/products.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/csv/products.csv",
      "bytes": 13547,
      "sha256": "24ed7ff2ab1e958e205c495c71b7daa28541408c89d6bc6cd40bf3c8a234080a",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/sub_assemblies.csv",
      "format": "csv",
      "table": "sub_assemblies",
      "key": "datasets/bill-of-materials/v1/csv/sub_assemblies.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/csv/sub_assemblies.csv",
      "bytes": 8906,
      "sha256": "f041cd77c12b80219407207d6d3d4b1f4d493b57dc2a7e17b5b62ed96fe8a4c7",
      "rows": 400,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/parts.csv",
      "format": "csv",
      "table": "parts",
      "key": "datasets/bill-of-materials/v1/csv/parts.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/csv/parts.csv",
      "bytes": 14075,
      "sha256": "7c5a32e86e2a654b3ecfb094e8bd9cac4c7c304158036dfa0a381d09a5769969",
      "rows": 600,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/suppliers.csv",
      "format": "csv",
      "table": "suppliers",
      "key": "datasets/bill-of-materials/v1/csv/suppliers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/csv/suppliers.csv",
      "bytes": 6999,
      "sha256": "59ad44e883be26121ff9af603b2ed31d1dec897438d237092635983bf3950fb3",
      "rows": 150,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "bill-of-materials.json",
      "format": "json",
      "table": null,
      "key": "datasets/bill-of-materials/v1/bill-of-materials.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/bill-of-materials.json",
      "bytes": 175734,
      "sha256": "0a7bafc374c5c4dd8b0fe3907255e7241e3523b537144190ca64bb4cf75ccb6e",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/bill-of-materials/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/sql/postgres.sql",
      "bytes": 61645,
      "sha256": "fcefdc1c4e0edca87109fcc1946aa80f3b9463381285b95d3e84484f1699088f",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/bill-of-materials/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/sql/mysql.sql",
      "bytes": 61124,
      "sha256": "813d36b06c7e26cd40bf8eacc758455c835b02348eceecf106c4683e8be5c99c",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/bill-of-materials/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/sql/mssql.sql",
      "bytes": 63053,
      "sha256": "56f950bf1c66ecff20561493edbb3993df0aa2c0d0aff4d2ed4016465232d3cd",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/bill-of-materials/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/sql/sqlite.sql",
      "bytes": 60973,
      "sha256": "a5e696de46b3040129f068f9caf666cd4dde81391cbff4ccc158e1d163a8fb35",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/bill-of-materials/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/prisma/seed.ts",
      "bytes": 140470,
      "sha256": "4a957a1c9ec9f3159e12f873ac8f1a59d9596f65d5550860c8ca876cfa810d65",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/bill-of-materials/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/bill-of-materials/v1/django/fixtures.json",
      "bytes": 220400,
      "sha256": "b383743935a8311f96c0d327461f33ca78233b4f88665994320b6ece9c114e27",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788734394228,
  "updatedAt": 1788734394228
}
