{
  "format": "dataset-manifest/1",
  "slug": "online-shop-orders",
  "version": 1,
  "seed": "online-shop-orders:1",
  "spec": {
    "format": "dataset/1",
    "slug": "online-shop-orders",
    "name": "Online Shop Orders",
    "tagline": "Manage and analyze orders in a mid-sized household goods online shop.",
    "description": "Online shops thrive by understanding customer behavior and order patterns. This dataset models a mid-sized e-commerce platform specializing in household goods, providing a comprehensive view of customers, product categories, orders, order items, and payments. With several interrelated tables, you can explore how frequently customers place orders, which categories are most popular, and how payments correlate with order frequencies. The dataset is synthetic, allowing developers to practice SQL queries, ORM seeding, and data analysis without the constraints of real data privacy issues. Each table is structured to enable complex queries, helping users gain insights into customer purchasing behavior, product performance, and payment trends.",
    "domain": "ecommerce",
    "shape": "transactional",
    "useCases": [
      "sql-practice",
      "orm-seeding"
    ],
    "keywords": [
      "orders",
      "customers",
      "products",
      "payments",
      "ecommerce",
      "household goods",
      "order history",
      "analytics"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "customers": {
        "description": "A customer table containing unique identifiers for customers and their information. Each row represents an individual customer.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each customer."
          },
          "full_name": {
            "kind": "fullName",
            "description": "The full name of the customer."
          },
          "email": {
            "kind": "email",
            "from": "full_name",
            "description": "Email address of the customer."
          },
          "created_at": {
            "kind": "datetime",
            "from": "2020-01-01",
            "to": "2023-01-01",
            "description": "The date when the customer was created.",
            "dayProfile": "waking"
          },
          "loyalty_points": {
            "kind": "int",
            "min": 0,
            "max": 1000,
            "description": "Loyalty points accumulated by the customer."
          }
        }
      },
      "categories": {
        "description": "A table representing different product categories. Each row corresponds to a unique product category.",
        "rows": 10,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each category."
          },
          "name": {
            "kind": "words",
            "max": 15,
            "description": "Name of the product category."
          },
          "description": {
            "kind": "sentence",
            "max": 50,
            "description": "A brief description of the category."
          }
        }
      },
      "products": {
        "description": "A product table containing details about products available for sale. Each row represents a unique product in a category.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each product."
          },
          "name": {
            "kind": "words",
            "max": 15,
            "description": "Name of the product."
          },
          "category_id": {
            "kind": "fk",
            "ref": "categories.id",
            "description": "Foreign key referencing the category of the product."
          },
          "price": {
            "kind": "decimal",
            "min": 5,
            "max": 500,
            "scale": 2,
            "description": "Price of the product."
          },
          "stock": {
            "kind": "int",
            "min": 0,
            "max": 1000,
            "description": "Current stock quantity of the product."
          }
        }
      },
      "orders": {
        "description": "An orders table that holds information about customer orders. Each row represents an individual order placed by a customer.",
        "rows": {
          "per": "customers",
          "via": "customer_id",
          "min": 1,
          "max": 5,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each order."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.id",
            "description": "Foreign key referencing the customer who made the order."
          },
          "order_date": {
            "kind": "datetime",
            "from": "2021-01-01",
            "to": "2023-12-31",
            "description": "The date when the order was placed.",
            "dayProfile": "waking",
            "trend": "growing"
          },
          "status": {
            "kind": "enum",
            "values": [
              "pending",
              "completed",
              "cancelled"
            ],
            "description": "Current status of the order."
          }
        }
      },
      "order_items": {
        "description": "A table that details products included in each order. Each row represents a specific product ordered.",
        "rows": {
          "per": "orders",
          "via": "order_id",
          "min": 1,
          "max": 3,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each order item."
          },
          "order_id": {
            "kind": "fk",
            "ref": "orders.id",
            "description": "Foreign key referencing the order this item belongs to."
          },
          "product_id": {
            "kind": "fk",
            "ref": "products.id",
            "description": "Foreign key referencing the product being ordered."
          },
          "quantity": {
            "kind": "int",
            "min": 1,
            "max": 10,
            "description": "Quantity of the product ordered."
          },
          "subtotal": {
            "kind": "decimal",
            "min": 5,
            "max": 5000,
            "scale": 2,
            "description": "Total price for this order item (quantity * product price)."
          }
        }
      },
      "payments": {
        "description": "A payments table that records payment details for each order. Each row corresponds to a payment made for an order.",
        "rows": {
          "per": "orders",
          "via": "order_id",
          "min": 1,
          "max": 1,
          "skew": "long-tail"
        },
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each payment."
          },
          "order_id": {
            "kind": "fk",
            "ref": "orders.id",
            "description": "Foreign key referencing the order for which the payment is made."
          },
          "payment_date": {
            "kind": "datetime",
            "from": "2021-01-01",
            "to": "2023-12-31",
            "description": "The date when the payment was made.",
            "dayProfile": "waking"
          },
          "amount": {
            "kind": "decimal",
            "min": 5,
            "max": 5000,
            "scale": 2,
            "description": "Total amount paid for the order."
          },
          "payment_method": {
            "kind": "enum",
            "values": [
              "credit_card",
              "paypal",
              "bank_transfer"
            ],
            "description": "Method used for the payment."
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "nullable",
      "timestamped",
      "monetary",
      "categorical"
    ],
    "analysisQuestions": [
      "What is the average order value for each customer?",
      "Which product categories are the most popular based on order frequency?",
      "How does the payment method affect the order completion rate?",
      "On which days do customers place the most orders?",
      "What is the trend of total sales over the months?"
    ],
    "suggestedQueries": [
      {
        "title": "Join Orders with Customers",
        "sql": "SELECT o.id, c.full_name FROM orders o JOIN customers c ON o.customer_id = c.id;",
        "dialect": "postgres"
      },
      {
        "title": "Count Orders by Status",
        "sql": "SELECT status, COUNT(*) FROM orders GROUP BY status;",
        "dialect": "postgres"
      },
      {
        "title": "Total Sales per Category",
        "sql": "SELECT c.name, SUM(oi.subtotal) FROM order_items oi JOIN products p ON oi.product_id = p.id JOIN categories c ON p.category_id = c.id GROUP BY c.name;",
        "dialect": "postgres"
      },
      {
        "title": "Average Payment Amounts",
        "sql": "SELECT AVG(amount) FROM payments;",
        "dialect": "postgres"
      },
      {
        "title": "Monthly Sales Trend",
        "sql": "SELECT DATE_TRUNC('month', o.order_date) AS month, SUM(oi.subtotal) FROM orders o JOIN order_items oi ON o.id = oi.order_id GROUP BY month ORDER BY month;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Customer Insights",
        "body": "Data analysts can utilize this dataset to generate insights on customer behavior and identify trends in ordering patterns. By analyzing the frequency of orders and customer loyalty points, they can tailor marketing strategies to improve customer retention."
      },
      {
        "title": "Product Performance Evaluation",
        "body": "Product managers can leverage the information from product and category tables to assess product performance based on sales data. They can identify high-performing products and categories, enabling informed decisions about inventory management and promotional efforts."
      },
      {
        "title": "Financial Reporting",
        "body": "Accountants can employ the payments table to generate financial reports and track payment performance over time. They can analyze which payment methods are most popular and how they correlate with order completion rates."
      },
      {
        "title": "Operational Efficiency",
        "body": "Operations teams can analyze order processing times and customer feedback to enhance the efficiency of order fulfillment. By monitoring the status of orders and the average time taken for payments, they can streamline operations and improve customer satisfaction."
      }
    ]
  },
  "counts": {
    "categories": 10,
    "customers": 200,
    "orders": 480,
    "payments": 480,
    "products": 100,
    "order_items": 791
  },
  "stats": {
    "customers": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "full_name": {
          "nulls": 0,
          "distinct": 194,
          "min": "Alice Tanaka",
          "max": "Zoe Silva"
        },
        "email": {
          "nulls": 0,
          "distinct": 197
        },
        "created_at": {
          "nulls": 0,
          "distinct": 200,
          "min": "2020-01-06 12:28:36",
          "max": "2022-12-29 22:34:07"
        },
        "loyalty_points": {
          "nulls": 0,
          "distinct": 182,
          "min": 16,
          "max": 1000
        }
      }
    },
    "categories": {
      "rows": 10,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "name": {
          "nulls": 0,
          "distinct": 10
        },
        "description": {
          "nulls": 0,
          "distinct": 10
        }
      }
    },
    "products": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "name": {
          "nulls": 0,
          "distinct": 100
        },
        "category_id": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "price": {
          "nulls": 0,
          "distinct": 100,
          "min": 6.97,
          "max": 493.48
        },
        "stock": {
          "nulls": 0,
          "distinct": 99,
          "min": 1,
          "max": 989
        }
      }
    },
    "orders": {
      "rows": 480,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 480,
          "min": 1,
          "max": 480
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "order_date": {
          "nulls": 0,
          "distinct": 480,
          "min": "2021-01-08 23:48:10",
          "max": "2023-12-31 14:22:44"
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "cancelled",
          "max": "pending"
        }
      }
    },
    "order_items": {
      "rows": 791,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 791,
          "min": 1,
          "max": 791
        },
        "order_id": {
          "nulls": 0,
          "distinct": 480,
          "min": 1,
          "max": 480
        },
        "product_id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "quantity": {
          "nulls": 0,
          "distinct": 10,
          "min": 1,
          "max": 10
        },
        "subtotal": {
          "nulls": 0,
          "distinct": 790,
          "min": 10.73,
          "max": 4997.15
        }
      }
    },
    "payments": {
      "rows": 480,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 480,
          "min": 1,
          "max": 480
        },
        "order_id": {
          "nulls": 0,
          "distinct": 480,
          "min": 1,
          "max": 480
        },
        "payment_date": {
          "nulls": 0,
          "distinct": 480,
          "min": "2021-01-01 17:41:03",
          "max": "2023-12-31 08:58:11"
        },
        "amount": {
          "nulls": 0,
          "distinct": 480,
          "min": 12.12,
          "max": 4992.01
        },
        "payment_method": {
          "nulls": 0,
          "distinct": 3,
          "min": "bank_transfer",
          "max": "paypal"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/categories.csv",
      "format": "csv",
      "table": "categories",
      "key": "datasets/online-shop-orders/v1/csv/categories.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/csv/categories.csv",
      "bytes": 1148,
      "sha256": "fb9922dded65f1736d7e8367b189dda2b82f319f944535128bb9069771c66377",
      "rows": 10,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/customers.csv",
      "format": "csv",
      "table": "customers",
      "key": "datasets/online-shop-orders/v1/csv/customers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/csv/customers.csv",
      "bytes": 12927,
      "sha256": "517867e0546803ebef4b6ec9ff8cc738822fca92b7be7cb29c3b5081286b5684",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/orders.csv",
      "format": "csv",
      "table": "orders",
      "key": "datasets/online-shop-orders/v1/csv/orders.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/csv/orders.csv",
      "bytes": 18108,
      "sha256": "f01f261f98b5e38ae40b26e0ff60525aae4bf402be9126638f624f9344742518",
      "rows": 480,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/payments.csv",
      "format": "csv",
      "table": "payments",
      "key": "datasets/online-shop-orders/v1/csv/payments.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/csv/payments.csv",
      "bytes": 22794,
      "sha256": "d481bb808a509f695da1645828436848a17a58947d40c1f8e87f346123c047cf",
      "rows": 480,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/products.csv",
      "format": "csv",
      "table": "products",
      "key": "datasets/online-shop-orders/v1/csv/products.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/csv/products.csv",
      "bytes": 7874,
      "sha256": "64a5e3e23b63de5f9a9c7a78181b3f300f7a67335ffbd6b7d88310b4dd9fcf9b",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/order_items.csv",
      "format": "csv",
      "table": "order_items",
      "key": "datasets/online-shop-orders/v1/csv/order_items.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/csv/order_items.csv",
      "bytes": 16973,
      "sha256": "e593053b1087149e82118fa40de1f5f942d16cc7765a6435f58cc3603619554c",
      "rows": 791,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "online-shop-orders.json",
      "format": "json",
      "table": null,
      "key": "datasets/online-shop-orders/v1/online-shop-orders.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/online-shop-orders.json",
      "bytes": 288810,
      "sha256": "9a4bea5c2ef9c1ed4259eb52f417706de10f297888cb47bba4bd24aa2459d64d",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/online-shop-orders/v1/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/sql/postgres.sql",
      "bytes": 108854,
      "sha256": "38f636a718206c5218eb547148a3d164e82238d42bf48b52608ee4332e408a34",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/online-shop-orders/v1/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/sql/mysql.sql",
      "bytes": 108172,
      "sha256": "f563e639830aaa6cf65080d0cfcbffb51a5c56623d8f6182a3e08fa27aed99a8",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/online-shop-orders/v1/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/sql/mssql.sql",
      "bytes": 111204,
      "sha256": "2c2d414c98d1bb309106c3c9c477752f2c22e68142f0614abbdaa011626908fa",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/online-shop-orders/v1/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/sql/sqlite.sql",
      "bytes": 107948,
      "sha256": "fcf5be9abac8dfd3f447c2084b16d99ce153fa491370d430dd26bffa9f81123c",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/online-shop-orders/v1/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/prisma/seed.ts",
      "bytes": 235317,
      "sha256": "c4c6a3e77687ead6adbd05050c7f52f8705c35ae992632f93c8004c99b707510",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/online-shop-orders/v1/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/online-shop-orders/v1/django/fixtures.json",
      "bytes": 376325,
      "sha256": "50e3db1ddfa811e80379351716a3cc1f13acb5a06b76a01f8b1697973715260b",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788768216489,
  "updatedAt": 1788768216489
}
