{
  "format": "dataset-manifest/1",
  "slug": "sales-warehouse",
  "version": 2,
  "seed": "sales-warehouse:1",
  "spec": {
    "format": "dataset/1",
    "slug": "sales-warehouse",
    "name": "Sales Warehouse",
    "tagline": "A star-schema dataset for retail sales analysis.",
    "description": "Retailers track sales activity meticulously, and this dataset represents a vibrant sales environment where transactions happen daily. Each sale is recorded in the sales_fact table, capturing essential details like quantities sold and returns as negative entries. The interplay between sales, products, stores, and customers creates a comprehensive view of the business operations. \n\nIn this structure, a row in the sales_fact table connects to specific entries in the date_dim, product_dim, store_dim, and customer_dim tables. Each entry in the date_dim defines the time of the transaction, allowing analysis over two years of daily activity. The product_dim table details the products sold, providing insights into inventory management and product performance. Meanwhile, the store_dim offers context about where purchases are made, highlighting the geographical aspects of sales. Customer_dim rows correspond to individual customers, enabling demographic and behavioral analysis. \n\nWith this dataset, developers can explore various analytical questions: What are the peak sales periods? Which products generate the most returns? How do customer demographics correlate with purchasing patterns? By examining these relationships, users can refine their data skills in SQL, data visualization, and business intelligence. The synthetic nature of this data allows for flexible experimentation without the concerns of working with real customer information, making it an ideal playground for developers to practice their data analysis techniques.",
    "domain": "ecommerce",
    "shape": "star-schema",
    "useCases": [
      "bi-dashboards",
      "etl-pipelines"
    ],
    "keywords": [
      "sales",
      "retail",
      "data warehouse",
      "star schema",
      "ecommerce",
      "synthetic data"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "sales_fact": {
        "description": "This table contains sales transaction records, linking to date, product, store, and customer dimensions. Each row represents a unique sale with details about the quantity sold and total sales amount.",
        "rows": 730,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each sales transaction."
          },
          "date_id": {
            "kind": "fk",
            "ref": "date_dim.id",
            "description": "Foreign key linking to the date dimension."
          },
          "product_id": {
            "kind": "fk",
            "ref": "product_dim.id",
            "description": "Foreign key linking to the product dimension."
          },
          "store_id": {
            "kind": "fk",
            "ref": "store_dim.id",
            "description": "Foreign key linking to the store dimension."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customer_dim.id",
            "nullable": true,
            "description": "Foreign key linking to the customer dimension, optional."
          },
          "quantity_sold": {
            "kind": "int",
            "min": -10,
            "max": 100,
            "distribution": "normal",
            "description": "Number of units sold in the transaction."
          },
          "total_sales": {
            "kind": "decimal",
            "min": -500,
            "max": 2000,
            "scale": 2,
            "distribution": "long-tail",
            "description": "Total revenue generated from the sale."
          }
        }
      },
      "date_dim": {
        "description": "This table provides detailed information about each date, including the day of the week, month, and year. Each row corresponds to a specific date.",
        "rows": 730,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each date entry."
          },
          "date": {
            "kind": "date",
            "from": "2022-01-01",
            "to": "2023-12-31",
            "description": "The actual date value."
          },
          "day_of_week": {
            "kind": "enum",
            "values": [
              "Monday",
              "Tuesday",
              "Wednesday",
              "Thursday",
              "Friday",
              "Saturday",
              "Sunday"
            ],
            "description": "The day of the week for the date.",
            "weights": [
              5,
              4,
              3,
              3,
              4,
              2,
              2
            ]
          },
          "month": {
            "kind": "int",
            "min": 1,
            "max": 12,
            "description": "Numeric representation of the month (1-12)."
          },
          "year": {
            "kind": "int",
            "min": 2022,
            "max": 2023,
            "description": "The year of the date."
          }
        }
      },
      "product_dim": {
        "description": "This table holds information about products available for sale, including their names, categories, and pricing. Each row represents a distinct product.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each product."
          },
          "product_name": {
            "kind": "productName",
            "description": "Name of the product."
          },
          "category": {
            "kind": "enum",
            "values": [
              "Electronics",
              "Clothing",
              "Home",
              "Sports",
              "Toys"
            ],
            "description": "Category to which the product belongs.",
            "weights": [
              6,
              5,
              4,
              3,
              2
            ]
          },
          "price": {
            "kind": "decimal",
            "min": 1,
            "max": 500,
            "scale": 2,
            "description": "Retail price of the product.",
            "distribution": "heavy-tail"
          }
        }
      },
      "store_dim": {
        "description": "This table contains details about the stores where sales occur, including their names, locations, and managers. Each row corresponds to a specific store.",
        "rows": 10,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each store."
          },
          "store_name": {
            "kind": "company",
            "description": "Name of the store."
          },
          "location": {
            "kind": "city",
            "description": "City where the store is located."
          },
          "manager": {
            "kind": "fullName",
            "description": "Name of the store manager."
          }
        }
      },
      "customer_dim": {
        "description": "This table provides information about customers, including their names, emails, and the date they joined. Each row corresponds to a specific customer.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each customer."
          },
          "first_name": {
            "kind": "firstName",
            "description": "First name of the customer."
          },
          "last_name": {
            "kind": "lastName",
            "description": "Last name of the customer."
          },
          "email": {
            "kind": "email",
            "from": [
              "first_name",
              "last_name"
            ],
            "description": "Email address of the customer."
          },
          "join_date": {
            "kind": "date",
            "from": "2020-01-01",
            "to": "2023-12-31",
            "description": "Date when the customer joined.",
            "trend": "growing"
          }
        }
      }
    },
    "suggestedQueries": [
      {
        "title": "Total Sales by Product",
        "sql": "SELECT product_dim.product_name, SUM(sales_fact.total_sales) AS total_sales FROM sales_fact JOIN product_dim ON sales_fact.product_id = product_dim.id GROUP BY product_dim.product_name;",
        "dialect": "postgres"
      },
      {
        "title": "Sales Quantity by Store",
        "sql": "SELECT store_dim.store_name, SUM(sales_fact.quantity_sold) AS total_quantity FROM sales_fact JOIN store_dim ON sales_fact.store_id = store_dim.id GROUP BY store_dim.store_name;",
        "dialect": "postgres"
      },
      {
        "title": "Average Sales by Day of Week",
        "sql": "SELECT date_dim.day_of_week, AVG(sales_fact.total_sales) AS average_sales FROM sales_fact JOIN date_dim ON sales_fact.date_id = date_dim.id GROUP BY date_dim.day_of_week;",
        "dialect": "postgres"
      },
      {
        "title": "Sales Trend Over Time",
        "sql": "SELECT date_dim.date, SUM(sales_fact.total_sales) AS daily_sales FROM sales_fact JOIN date_dim ON sales_fact.date_id = date_dim.id WHERE date_dim.date BETWEEN '2023-01-01' AND '2023-12-31' GROUP BY date_dim.date ORDER BY date_dim.date;",
        "dialect": "postgres"
      },
      {
        "title": "Top Customers by Total Spending",
        "sql": "SELECT customer_dim.first_name, customer_dim.last_name, SUM(sales_fact.total_sales) AS total_spent FROM sales_fact JOIN customer_dim ON sales_fact.customer_id = customer_dim.id GROUP BY customer_dim.first_name, customer_dim.last_name ORDER BY total_spent DESC;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Sales Performance Analysis",
        "body": "A sales manager at an e-commerce company would utilize this dataset to analyze the performance of various products across different stores. They might want to identify which products are driving the most revenue and assess the effectiveness of marketing campaigns. By examining total sales and quantities sold, they can make informed decisions about inventory management and product promotions."
      },
      {
        "title": "Customer Behavior Insights",
        "body": "A marketing analyst could leverage this dataset to understand customer behavior patterns. By analyzing the join_date and total_sales, they can identify trends in customer spending over time and assess the impact of customer acquisition strategies. This information would be crucial for tailoring marketing efforts to specific customer segments and improving retention rates."
      },
      {
        "title": "Store Performance Comparison",
        "body": "A regional manager may access this dataset to compare the performance of different stores within their region. By looking at total sales and quantities sold by store, they can identify underperforming locations and develop strategies to boost sales. This analysis could also help in resource allocation and staffing decisions based on store performance."
      }
    ],
    "analysisQuestions": [
      "Which products have the highest total sales?",
      "What is the average quantity sold per transaction?",
      "How do sales vary by day of the week?",
      "Which stores have the highest sales revenue?"
    ]
  },
  "counts": {
    "customer_dim": 200,
    "date_dim": 730,
    "product_dim": 100,
    "store_dim": 10,
    "sales_fact": 730
  },
  "stats": {
    "sales_fact": {
      "rows": 730,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 730,
          "min": 1,
          "max": 730
        },
        "date_id": {
          "nulls": 0,
          "distinct": 451,
          "min": 2,
          "max": 730
        },
        "product_id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "store_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "customer_id": {
          "nulls": 75,
          "distinct": 189,
          "min": 1,
          "max": 199
        },
        "quantity_sold": {
          "nulls": 0,
          "distinct": 79,
          "min": -2,
          "max": 88
        },
        "total_sales": {
          "nulls": 0,
          "distinct": 727,
          "min": -500,
          "max": 1999.15
        }
      }
    },
    "date_dim": {
      "rows": 730,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 730,
          "min": 1,
          "max": 730
        },
        "date": {
          "nulls": 0,
          "distinct": 454,
          "min": "2022-01-02",
          "max": "2023-12-31"
        },
        "day_of_week": {
          "nulls": 0,
          "distinct": 7,
          "min": "Friday",
          "max": "Wednesday"
        },
        "month": {
          "nulls": 0,
          "distinct": 12,
          "min": 1,
          "max": 12
        },
        "year": {
          "nulls": 0,
          "distinct": 2,
          "min": 2022,
          "max": 2023
        }
      }
    },
    "product_dim": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "product_name": {
          "nulls": 0,
          "distinct": 90,
          "min": "Classic Blender",
          "max": "Wireless Router"
        },
        "category": {
          "nulls": 0,
          "distinct": 5,
          "min": "Clothing",
          "max": "Toys"
        },
        "price": {
          "nulls": 0,
          "distinct": 98,
          "min": 1,
          "max": 466.91
        }
      }
    },
    "store_dim": {
      "rows": 10,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "store_name": {
          "nulls": 0,
          "distinct": 10,
          "min": "Apex Systems",
          "max": "Willow Energy"
        },
        "location": {
          "nulls": 0,
          "distinct": 8,
          "min": "Denver",
          "max": "Warsaw"
        },
        "manager": {
          "nulls": 0,
          "distinct": 10,
          "min": "Arjun Clark",
          "max": "Zara Wilson"
        }
      }
    },
    "customer_dim": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "first_name": {
          "nulls": 0,
          "distinct": 68,
          "min": "Alice",
          "max": "Zoe"
        },
        "last_name": {
          "nulls": 0,
          "distinct": 74,
          "min": "Adams",
          "max": "Zhang"
        },
        "email": {
          "nulls": 0,
          "distinct": 199
        },
        "join_date": {
          "nulls": 0,
          "distinct": 182,
          "min": "2020-01-08",
          "max": "2023-12-30"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/customer_dim.csv",
      "format": "csv",
      "table": "customer_dim",
      "key": "datasets/sales-warehouse/v2/csv/customer_dim.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/csv/customer_dim.csv",
      "bytes": 10365,
      "sha256": "2cfc8901a9f4489f7807339bf15e063b2b875fdafadc78b14a39e5e628164dd0",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/date_dim.csv",
      "format": "csv",
      "table": "date_dim",
      "key": "datasets/sales-warehouse/v2/csv/date_dim.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/csv/date_dim.csv",
      "bytes": 22759,
      "sha256": "c367398131a45cc97e3bd909ee82975aabe90d25991ba78723c7671eeac25442",
      "rows": 730,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/product_dim.csv",
      "format": "csv",
      "table": "product_dim",
      "key": "datasets/sales-warehouse/v2/csv/product_dim.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/csv/product_dim.csv",
      "bytes": 3337,
      "sha256": "f4efe0fcc130c10d0b5f5c88804b08005b0bdfd8ea762205c2d23d5e8b12881a",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/store_dim.csv",
      "format": "csv",
      "table": "store_dim",
      "key": "datasets/sales-warehouse/v2/csv/store_dim.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/csv/store_dim.csv",
      "bytes": 406,
      "sha256": "6f172b2865275078108744161ab659711d9985d9ac8d1c2e0bb20ea31cef94ff",
      "rows": 10,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/sales_fact.csv",
      "format": "csv",
      "table": "sales_fact",
      "key": "datasets/sales-warehouse/v2/csv/sales_fact.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/csv/sales_fact.csv",
      "bytes": 20137,
      "sha256": "188cd70aa7d1df5c89041998fc2e46285432094ecf5112346ad70cce28f2a3fa",
      "rows": 730,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "sales-warehouse.json",
      "format": "json",
      "table": null,
      "key": "datasets/sales-warehouse/v2/sales-warehouse.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/sales-warehouse.json",
      "bytes": 267940,
      "sha256": "97e118c2f3ff47cd9edf7eaa5a82e8649173e433b281ee262fe6006746ed2c30",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/sales-warehouse/v2/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/sql/postgres.sql",
      "bytes": 84605,
      "sha256": "aa0446a8488b7d301be75d9db2a80e39501dc9cbf6c18b176ea7d4c812521858",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/sales-warehouse/v2/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/sql/mysql.sql",
      "bytes": 84026,
      "sha256": "df2fdd94866b2c2ec2d0e56504b7f8bdb5fd055442c8143a8393cad6fa4540f8",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/sales-warehouse/v2/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/sql/mssql.sql",
      "bytes": 86850,
      "sha256": "fbac2d115b67116a8829582af0b972c478d19631a09ad68d2b0d89325aa82828",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/sales-warehouse/v2/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/sql/sqlite.sql",
      "bytes": 83820,
      "sha256": "0ee1a3002268548ac09b6ac75481ad1e7aee7f8b0cd705b1944cd86cd1f99bcb",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/sales-warehouse/v2/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/prisma/seed.ts",
      "bytes": 196279,
      "sha256": "2c9c9ad5611b27d8ba0f7418756df7be7b6d4e910d95d1dcf2fe6ef0a39bf07b",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/sales-warehouse/v2/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/sales-warehouse/v2/django/fixtures.json",
      "bytes": 341310,
      "sha256": "a7155483234dcdb03111b3dca1f4fc91b486a22b98c2645b5ff2a9309df1ad54",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788733941113,
  "updatedAt": 1788785834210
}
