{
  "format": "dataset-manifest/1",
  "slug": "pharmacy",
  "version": 2,
  "seed": "pharmacy:1",
  "spec": {
    "format": "dataset/1",
    "slug": "pharmacy",
    "name": "Pharmacy Transactions Dataset",
    "tagline": "Pharmacy transactions including customers, medications, prescriptions, and insurance claims from a busy pharmacy.",
    "description": "A busy pharmacy manages the intricate flow of medications, customer prescriptions, and insurance claims, all while ensuring that patients receive the right treatments. Each day, pharmacists dispense a variety of medications, ranging from common prescriptions to specialty drugs, while also handling the paperwork required for insurance reimbursements. This operational hub is crucial for maintaining the health of the community, ensuring that everyone has access to necessary medications in a timely manner.\n\nIn this dataset, the relationships between the tables provide a comprehensive view of pharmacy operations. The 'customers' table includes individual patient information, linking directly to the 'prescriptions' table, which details the medications each customer has been prescribed. The 'medications' table outlines the specific drugs available at the pharmacy, including dosage and type, while the 'transactions' table records each purchase made by customers, connecting to both the 'customers' and 'prescriptions' tables to reflect what was bought and by whom. Additionally, the 'insurance_claims' table tracks the claims filed against each transaction, detailing the interaction between the pharmacy and insurance providers.\n\nThis dataset answers a variety of pertinent questions related to pharmacy operations. Users can investigate trends in common versus rare medication prescriptions, analyze customer purchasing patterns, and evaluate the efficiency of insurance claims processing. With synthetic data designed to mimic real-world scenarios, this dataset provides an excellent opportunity for developers and analysts to practice their skills. Whether you are looking to refine your data manipulation techniques or perform complex queries to derive insights, the Pharmacy Transactions Dataset offers a rich landscape for exploration.",
    "domain": "pharmacy",
    "shape": "transactional",
    "useCases": [
      "sql-practice",
      "orm-seeding"
    ],
    "keywords": [
      "pharmacy",
      "transactions",
      "prescriptions",
      "insurance",
      "medications",
      "customers"
    ],
    "locale": "en",
    "license": "CC0-1.0",
    "version": 1,
    "tables": {
      "customers": {
        "description": "This table contains information about pharmacy customers. Each row represents a unique customer with their details linked to transactions and prescriptions.",
        "rows": 100,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each customer."
          },
          "first_name": {
            "kind": "firstName",
            "description": "Customer's first name."
          },
          "last_name": {
            "kind": "lastName",
            "description": "Customer's last name."
          },
          "date_of_birth": {
            "kind": "date",
            "from": "1950-01-01",
            "to": "2005-12-31",
            "description": "Customer's date of birth."
          },
          "email": {
            "kind": "email",
            "from": [
              "first_name",
              "last_name"
            ],
            "description": "Customer's email address."
          }
        }
      },
      "medications": {
        "description": "This table lists all medications available at the pharmacy. Each row represents a unique medication with associated details.",
        "rows": 50,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each medication."
          },
          "name": {
            "kind": "productName",
            "description": "Name of the medication."
          },
          "category": {
            "kind": "enum",
            "values": [
              "Prescription",
              "Over-the-Counter",
              "Specialty"
            ],
            "description": "Category of the medication."
          },
          "stock_quantity": {
            "kind": "int",
            "min": 0,
            "max": 200,
            "description": "Current stock quantity of the medication."
          }
        }
      },
      "prescriptions": {
        "description": "This table contains details about prescriptions issued to customers. Each row links to a customer and a medication indicating what was prescribed.",
        "rows": 200,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each prescription."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.id",
            "description": "Link to the customer who received the prescription."
          },
          "medication_id": {
            "kind": "fk",
            "ref": "medications.id",
            "description": "Link to the prescribed medication."
          },
          "date_prescribed": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the prescription was issued."
          },
          "quantity": {
            "kind": "int",
            "min": 1,
            "max": 30,
            "description": "Quantity of medication prescribed.",
            "distribution": "long-tail"
          }
        }
      },
      "transactions": {
        "description": "This table records all transactions made in the pharmacy, linking customers to their purchases and the medications involved.",
        "rows": 300,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each transaction."
          },
          "customer_id": {
            "kind": "fk",
            "ref": "customers.id",
            "description": "Link to the customer who made the transaction."
          },
          "prescription_id": {
            "kind": "fk",
            "ref": "prescriptions.id",
            "nullable": true,
            "description": "Link to the prescription associated with the transaction, if applicable."
          },
          "transaction_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the transaction occurred."
          },
          "total_amount": {
            "kind": "decimal",
            "min": 5,
            "max": 500,
            "scale": 2,
            "description": "Total amount for the transaction.",
            "distribution": "long-tail"
          }
        }
      },
      "insurance_claims": {
        "description": "This table tracks insurance claims processed for transactions. Each row relates to a transaction and contains information about the claim status.",
        "rows": 150,
        "columns": {
          "id": {
            "kind": "pk",
            "description": "Unique identifier for each insurance claim."
          },
          "transaction_id": {
            "kind": "fk",
            "ref": "transactions.id",
            "description": "Link to the transaction for which the claim is made."
          },
          "claim_date": {
            "kind": "date",
            "from": "2023-01-01",
            "to": "2024-12-31",
            "description": "Date when the insurance claim was submitted."
          },
          "status": {
            "kind": "enum",
            "values": [
              "Pending",
              "Approved",
              "Denied"
            ],
            "description": "Current status of the insurance claim.",
            "weights": [
              6,
              3,
              1
            ]
          }
        }
      }
    },
    "structure": "multi-table",
    "traits": [
      "categorical",
      "timestamped",
      "monetary"
    ],
    "analysisQuestions": [
      "What medications are most frequently prescribed and purchased?",
      "How do insurance claim approval rates vary by medication category?",
      "What is the average transaction amount over the dataset period?",
      "How does customer age affect the types of medications prescribed?",
      "What trends can be observed in transaction volumes over time?"
    ],
    "suggestedQueries": [
      {
        "title": "Get all transactions for a specific customer",
        "sql": "SELECT * FROM transactions WHERE customer_id = $1;",
        "dialect": "postgres"
      },
      {
        "title": "Count the number of prescriptions per medication",
        "sql": "SELECT medication_id, COUNT(*) FROM prescriptions GROUP BY medication_id;",
        "dialect": "postgres"
      },
      {
        "title": "Average transaction amount by transaction date",
        "sql": "SELECT transaction_date, AVG(total_amount) FROM transactions GROUP BY transaction_date;",
        "dialect": "postgres"
      },
      {
        "title": "List all insurance claims with their statuses",
        "sql": "SELECT insurance_claims.id, status FROM insurance_claims JOIN transactions ON insurance_claims.transaction_id = transactions.id;",
        "dialect": "postgres"
      }
    ],
    "usageScenarios": [
      {
        "title": "Pharmacy Data Analysis",
        "body": "Data analysts working for a pharmacy chain can use this dataset to analyze transaction patterns, evaluate the effectiveness of marketing campaigns, and identify best-selling medications. By querying the dataset, they can generate reports that help inform business decisions and strategies."
      },
      {
        "title": "ORM Seeding for Pharmacy Management Software",
        "body": "Developers creating pharmacy management software can use this dataset to seed their databases. By populating the system with realistic customer, medication, and transaction data, they can test functionalities and ensure the software meets user needs effectively."
      },
      {
        "title": "Insurance Claims Processing Optimization",
        "body": "Insurance companies can utilize the dataset to analyze claims related to medications. By assessing claim approval rates and reasons for denials, they can work on optimizing their processes and improving customer satisfaction."
      },
      {
        "title": "Research on Medication Usage Trends",
        "body": "Healthcare researchers can leverage this dataset to study medication usage trends in different demographics. By analyzing prescription data alongside customer information, they can gain insights into public health trends and the effectiveness of various treatments."
      }
    ]
  },
  "counts": {
    "customers": 100,
    "medications": 50,
    "prescriptions": 200,
    "transactions": 300,
    "insurance_claims": 150
  },
  "stats": {
    "customers": {
      "rows": 100,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 100,
          "min": 1,
          "max": 100
        },
        "first_name": {
          "nulls": 0,
          "distinct": 58,
          "min": "Alice",
          "max": "Zara"
        },
        "last_name": {
          "nulls": 0,
          "distinct": 58,
          "min": "Ali",
          "max": "Zhang"
        },
        "date_of_birth": {
          "nulls": 0,
          "distinct": 100,
          "min": "1950-02-03",
          "max": "2005-08-24"
        },
        "email": {
          "nulls": 0,
          "distinct": 100
        }
      }
    },
    "medications": {
      "rows": 50,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 50,
          "min": 1,
          "max": 50
        },
        "name": {
          "nulls": 0,
          "distinct": 46,
          "min": "Classic Monitor",
          "max": "Wireless Toolkit"
        },
        "category": {
          "nulls": 0,
          "distinct": 3,
          "min": "Over-the-Counter",
          "max": "Specialty"
        },
        "stock_quantity": {
          "nulls": 0,
          "distinct": 46,
          "min": 7,
          "max": 199
        }
      }
    },
    "prescriptions": {
      "rows": 200,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 200,
          "min": 1,
          "max": 200
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 87,
          "min": 1,
          "max": 100
        },
        "medication_id": {
          "nulls": 0,
          "distinct": 47,
          "min": 2,
          "max": 50
        },
        "date_prescribed": {
          "nulls": 0,
          "distinct": 177,
          "min": "2023-01-07",
          "max": "2024-12-30"
        },
        "quantity": {
          "nulls": 0,
          "distinct": 29,
          "min": 1,
          "max": 30
        }
      }
    },
    "transactions": {
      "rows": 300,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 300,
          "min": 1,
          "max": 300
        },
        "customer_id": {
          "nulls": 0,
          "distinct": 95,
          "min": 1,
          "max": 100
        },
        "prescription_id": {
          "nulls": 28,
          "distinct": 148,
          "min": 1,
          "max": 199
        },
        "transaction_date": {
          "nulls": 0,
          "distinct": 252,
          "min": "2023-01-03",
          "max": "2024-12-31"
        },
        "total_amount": {
          "nulls": 0,
          "distinct": 296,
          "min": 5,
          "max": 495.88
        }
      }
    },
    "insurance_claims": {
      "rows": 150,
      "columns": {
        "id": {
          "nulls": 0,
          "distinct": 150,
          "min": 1,
          "max": 150
        },
        "transaction_id": {
          "nulls": 0,
          "distinct": 123,
          "min": 1,
          "max": 296
        },
        "claim_date": {
          "nulls": 0,
          "distinct": 132,
          "min": "2023-01-02",
          "max": "2024-12-14"
        },
        "status": {
          "nulls": 0,
          "distinct": 3,
          "min": "Approved",
          "max": "Pending"
        }
      }
    }
  },
  "artifacts": [
    {
      "file": "csv/customers.csv",
      "format": "csv",
      "table": "customers",
      "key": "datasets/pharmacy/v2/csv/customers.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/csv/customers.csv",
      "bytes": 5157,
      "sha256": "f129de1a9f2f078a0f2a740bf13b1edfb8342757fd5234999b17c712d504fc02",
      "rows": 100,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/medications.csv",
      "format": "csv",
      "table": "medications",
      "key": "datasets/pharmacy/v2/csv/medications.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/csv/medications.csv",
      "bytes": 1816,
      "sha256": "c7a260f72db4b6927393a4c34ab6419e6dd4efcf1c99a3001d72ee3563ada55e",
      "rows": 50,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/prescriptions.csv",
      "format": "csv",
      "table": "prescriptions",
      "key": "datasets/pharmacy/v2/csv/prescriptions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/csv/prescriptions.csv",
      "bytes": 4797,
      "sha256": "5683cacff29abe31cb99143e07e38c79f58b967fdba3812944d4f070de9c82ca",
      "rows": 200,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/transactions.csv",
      "format": "csv",
      "table": "transactions",
      "key": "datasets/pharmacy/v2/csv/transactions.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/csv/transactions.csv",
      "bytes": 8539,
      "sha256": "a9085b7e72d99642a450682585b8b184c1edf107ef3cbd7c68e413bbd032162a",
      "rows": 300,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "csv/insurance_claims.csv",
      "format": "csv",
      "table": "insurance_claims",
      "key": "datasets/pharmacy/v2/csv/insurance_claims.csv",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/csv/insurance_claims.csv",
      "bytes": 4105,
      "sha256": "9282f198507636e93d0ec3fe87a3a72698f26f6285a7d3fa0deaa08967dafaab",
      "rows": 150,
      "contentType": "text/csv; charset=utf-8"
    },
    {
      "file": "pharmacy.json",
      "format": "json",
      "table": null,
      "key": "datasets/pharmacy/v2/pharmacy.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/pharmacy.json",
      "bytes": 114276,
      "sha256": "7691727fc8b2514fe9c3e63e5972c1d51ede55e54722f976a1032f3695ae5824",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    },
    {
      "file": "sql/postgres.sql",
      "format": "sql-postgres",
      "table": null,
      "key": "datasets/pharmacy/v2/sql/postgres.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/sql/postgres.sql",
      "bytes": 37896,
      "sha256": "6eb70d97ca5e9e3c17dfdde645d22b5e8613c151e9833401b499404f9273453a",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mysql.sql",
      "format": "sql-mysql",
      "table": null,
      "key": "datasets/pharmacy/v2/sql/mysql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/sql/mysql.sql",
      "bytes": 37295,
      "sha256": "429814aabb3940500bc900671acf295d555da2a38eaaa8f1864ece5c2696cc0c",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/mssql.sql",
      "format": "sql-mssql",
      "table": null,
      "key": "datasets/pharmacy/v2/sql/mssql.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/sql/mssql.sql",
      "bytes": 38948,
      "sha256": "16874c3acbfe85c4328d56041efcca51743693ce5410f2dde42d940c2d0d6233",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "sql/sqlite.sql",
      "format": "sql-sqlite",
      "table": null,
      "key": "datasets/pharmacy/v2/sql/sqlite.sql",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/sql/sqlite.sql",
      "bytes": 37028,
      "sha256": "7066cbb5a8e7b25d3059131d443cd32ebc44e506f4975f7f012bc09a75a58b89",
      "rows": null,
      "contentType": "application/sql; charset=utf-8"
    },
    {
      "file": "prisma/seed.ts",
      "format": "prisma-seed",
      "table": null,
      "key": "datasets/pharmacy/v2/prisma/seed.ts",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/prisma/seed.ts",
      "bytes": 88641,
      "sha256": "e82fec25e804a3f0e4508020fc298c0add9bc33650ecb18f99dd36986fc7a134",
      "rows": null,
      "contentType": "application/typescript; charset=utf-8"
    },
    {
      "file": "django/fixtures.json",
      "format": "django-fixture",
      "table": null,
      "key": "datasets/pharmacy/v2/django/fixtures.json",
      "url": "https://database-sample-website.s3.eu-north-1.amazonaws.com/datasets/pharmacy/v2/django/fixtures.json",
      "bytes": 150047,
      "sha256": "8a2267d489b0b751a76aa2c06de20d689564d3f6c0f70d9f452c169401e71329",
      "rows": null,
      "contentType": "application/json; charset=utf-8"
    }
  ],
  "publishedAt": 1788767832053,
  "updatedAt": 1788785441634
}
