Pharmacy Dataset for Analysis
This is a ready-made synthetic dataset for pharmacy sales and inventory analysis. It covers transactions and stock levels between 2023-01-01 and 2024-12-31. A free sample is available, with full downloads costing credits.
At a glance
- 3tables
- 77,059rows
- 15columns
- Jan 2023 – Dec 2024date range
The 3 tables
preview and data dictionary per tableProducts products · dimension table · 500 rows
Catalog of pharmacy products.
Preview
| product_iduuid | product_namestring | categorystring | unit_costdecimal | list_pricedecimal |
|---|---|---|---|---|
| 39854299-c476-4d4f-8ae8-00ab1b9469d5 | Amlodipine Besylate | Prescription | 24.82 | 45.57 |
| 387d1de3-9aa0-4070-84e6-1937c673943b | Atorvastatin Calcium | Prescription | 27.67 | 66.04 |
| 6dde6dfb-8408-46cc-ab66-d808818467dd | Lisinopril Diuretic | Prescription | 41 | 96.98 |
| de3db61d-b74c-4e56-bf05-f394ced8a7b2 | Metformin HCl | Prescription | 11.96 | 19.6 |
| 7c2cf757-afd9-4c9f-bbef-edbdffb399e4 | Simvastatin | Prescription | 24.99 | 31.97 |
| 4cfddbcf-06c6-4cbe-8c77-a54296b751e4 | Levothyroxine Sodium | Prescription | 22.76 | 33.89 |
| d40bc8e3-ba0b-4e2d-8fdd-441897bc5712 | Albuterol Sulfate | Prescription | 13.89 | 22.19 |
| 149c7502-dedf-4f6d-a29e-17ace2736033 | Omeprazole Delayed Release | Prescription | 30.35 | 44.14 |
| 9477015b-c015-482d-86b8-bb08c55a4ba1 | Losartan Potassium | Prescription | 19.14 | 37.16 |
| b17c9f2b-4bfd-4770-95e9-e81b8465fef8 | Gabapentin | Prescription | 10.97 | 17.72 |
Data dictionary
| column | type | description | example | null % |
|---|---|---|---|---|
product_ | uuid | Unique identifier for each pharmacy catalog product.unique | 39854299-c476-4d4f-8ae8-00ab1b9469d5 | 0% |
product_ | string | Trade name, brand name, or generic clinical formulation of the medication or supply item. | Amlodipine Besylate | 0% |
category | string | Classification category indicating legal and operational dispensation type. | Prescription | 0% |
unit_ | decimal | Wholesale acquisition cost per unit incurred by the pharmacy. | 24.82 | 0% |
list_ | decimal | Standard shelf or baseline retail price charged to customers before promotional discounts. | 45.57 | 0% |
Inventory inventory · dimension table · 71,559 rows
Snapshot records of product inventory levels.
Preview
| inventory_iduuid | snapshot_datedate | quantity_on_handinteger | product_iduuid |
|---|---|---|---|
| b38a91e5-7703-42bc-bfc1-0a86200159a7 | 2024-04-30 | 612 | d40bc8e3-ba0b-4e2d-8fdd-441897bc5712 |
| 83322970-41aa-40c2-aa99-cc957af72074 | 2023-03-31 | 420 | 39854299-c476-4d4f-8ae8-00ab1b9469d5 |
| c4399186-6264-4055-a1a6-20781d41cd70 | 2024-12-14 | 588 | 6dde6dfb-8408-46cc-ab66-d808818467dd |
| fe3f6956-5b76-4cf2-b017-30238a198e9b | 2024-12-08 | 527 | 4cfddbcf-06c6-4cbe-8c77-a54296b751e4 |
| 888c43c0-f28d-4c3c-97ee-d4b9d0336304 | 2023-09-28 | 276 | 6dde6dfb-8408-46cc-ab66-d808818467dd |
| 369be0f1-6e8f-4f2c-a08a-6abd84d408c4 | 2024-02-02 | 525 | 4cfddbcf-06c6-4cbe-8c77-a54296b751e4 |
| e80729c6-0631-403d-9497-7e0008256729 | 2023-09-18 | 210 | de3db61d-b74c-4e56-bf05-f394ced8a7b2 |
| 3ca5a5aa-12c3-4834-af78-a205c97bce9f | 2024-08-04 | 148 | 6dde6dfb-8408-46cc-ab66-d808818467dd |
| 0dbe20d5-8cb2-414b-a646-745afe52ec98 | 2024-05-15 | 434 | 4cfddbcf-06c6-4cbe-8c77-a54296b751e4 |
| fc42ea90-a262-4d66-a827-6452c8ee34ef | 2023-02-02 | 347 | 7c2cf757-afd9-4c9f-bbef-edbdffb399e4 |
Data dictionary
| column | type | description | example | null % |
|---|---|---|---|---|
inventory_ | uuid | Unique primary key identifier for the inventory snapshot record. | 8f90108b-61e0-4aa5-994b-7137acf59a60 | 0% |
snapshot_ | date | The date when this inventory level was recorded. | 2024-09-05 | 0% |
quantity_ | integer | Number of units physically available in stock at snapshot time. | 440 | 0% |
product_ | uuid | Foreign key to products.product_id. | 443d3384-dc11-41e4-ae6a-5d86426b8f8e | 0% |
Sales sales · table · 5,000 rows
Records of individual sales transactions.
Preview
| sale_iduuid | sale_datedate | quantity_soldinteger | unit_pricedecimal | transaction_totaldecimal | product_iduuid |
|---|---|---|---|---|---|
| 472a134a-9d59-4fc3-927e-f4587556e95f | 2024-10-23 | 1 | 29.43 | 29.43 | 3b39d8c0-1154-4dd0-8a49-2fbde7cc7580 |
| 70840626-8e32-4639-bdcd-ebea27221640 | 2024-04-28 | 1 | 74.08 | 74.08 | 16ef8115-591c-4e40-a0bf-ac2e3727bb59 |
| 7a133b26-eb1d-4b28-83e6-6b7905880896 | 2024-07-25 | 1 | 58.83 | 58.83 | 8f0c2d20-035b-471f-ad16-8a7fb72936d6 |
| ca3a6a1a-e9e3-45bc-b823-ec0db69c6ff9 | 2024-12-17 | 1 | 18.65 | 18.65 | c6178f74-2ec4-4d4a-b70b-d9dc8e39e179 |
| 0689fc85-9151-447b-bcfb-a4a2342642b1 | 2023-01-02 | 1 | 26.65 | 26.65 | aab6cf28-efbe-42d9-9d36-5717fc5973e0 |
| 231b49b8-7d25-4580-b250-dd1df10aa25f | 2024-03-31 | 1 | 15.98 | 15.98 | e3450983-0efe-4dcc-a4d3-6257f4ad5482 |
| 7b8da670-c27f-4de7-94f9-ce9a20f62549 | 2023-04-07 | 1 | 62.08 | 62.08 | 681d9925-98a7-4b01-99bb-7f0bd3a63ba2 |
| dea79660-5f7a-4fea-b204-6d1c7dc83825 | 2024-07-11 | 1 | 35.02 | 35.02 | 24efb3e6-917d-4417-95ed-ce5670ac39e0 |
| ddd6ef25-e70d-4ff6-8427-0029844439f9 | 2023-06-19 | 1 | 21.98 | 21.98 | dd6437a4-0147-4679-8dfd-2e865f8c5251 |
| 4b40ebb9-4844-4825-bedb-0f71f7698580 | 2023-04-02 | 1 | 22.76 | 22.76 | f7326eda-e280-42bf-a549-7933c5a10379 |
Data dictionary
| column | type | description | example | null % |
|---|---|---|---|---|
sale_ | uuid | Unique identifier for the sale transaction.unique | 472a134a-9d59-4fc3-927e-f4587556e95f | 0% |
sale_ | date | Date when the sale transaction occurred. | 2024-10-23 | 0% |
quantity_ | integer | Total quantity of product units sold in the transaction. | 1 | 0% |
unit_ | decimal | Actual unit selling price of the product after retail variations or discounts. | 29.43 | 0% |
transaction_ | decimal | Total dollar amount of the sale transaction, equal to quantity_sold times unit_price. | 29.43 | 0% |
product_ | uuid | Foreign key to products.product_id. | 3b39d8c0-1154-4dd0-8a49-2fbde7cc7580 | 0% |
How the tables join
inventory.product_id references products.product_idmany to one: each Inventory row points to one Products rowsales.product_id references products.product_idmany to one: each Sales row points to one Products row
Questions to answer with it
Which products have the highest sales volume (total quantity sold)? Show top 10 products.
Join sales and products tables, group by product, sum quantity_sold, order by sum DESC.
tables: sales, products
Identify products that are low in inventory (quantity_on_hand < 50) but high in demand (average daily sales > 5).
Calculate average daily sales per product from sales, then join with inventory and filter.
tables: sales, inventory, products
Analyze the sales trend of prescription versus over-the-counter drugs over time.
Join sales and products, group by category and date, sum transaction_total.
tables: sales, products
Starter SQL
run against this data before publishingTable names match the SQLite file and the SQL script.
Top 20 Products by Quantity Sold
SELECT p.product_name, SUM(s.quantity_sold) AS total_quantity
FROM sales s
JOIN products p ON s.product_id = p.product_id
GROUP BY p.product_name
ORDER BY total_quantity DESC
LIMIT 20;Monthly Sales Trend by Category
SELECT
strftime('%Y-%m', s.sale_date) AS sale_month,
p.category,
SUM(s.transaction_total) AS monthly_revenue
FROM sales s
JOIN products p ON s.product_id = p.product_id
GROUP BY sale_month, p.category
ORDER BY sale_month, p.category
LIMIT 20;Total Revenue per Product Category
SELECT
p.category,
SUM(s.transaction_total) AS total_revenue
FROM sales s
JOIN products p ON s.product_id = p.product_id
GROUP BY p.category
ORDER BY total_revenue DESC
LIMIT 20;Load it with pandas
import pandas as pd
# Unzip the CSV download first: one file per table
products = pd.read_csv("products.csv")
inventory = pd.read_csv("inventory.csv")
sales = pd.read_csv("sales.csv")
# Join inventory to products
df = inventory.merge(products, left_on="product_id", right_on="product_id", how="left", suffixes=("", "_products"))
print(df.groupby("category").size().sort_values(ascending=False))Using it in your tool
- Excel
- Load each table into a separate sheet. Use XLOOKUP or Power Query to join tables. Create a PivotTable on the sales data, grouping by product category and date.
- Power BI
- Create a star schema with 'products' as the dimension table and 'sales' and 'inventory' as fact tables. Establish relationships on 'product_id'. DAX measures could include Total Sales Amount and Current Stock Level.
- SQL
- Load the SQLite or SQL dump into your preferred database. Primary keys are defined in the schema. Join tables using product_id to link sales and inventory to product details.
- Python
- Use pandas to load CSV or SQL data. Merge tables on 'product_id'. Analyze sales trends and inventory levels using DataFrame operations.
Formats available
- CSV (zip)One CSV file per table, zipped
- Excel workbookOne worksheet per table
- SQLite databaseA ready-to-query database file with every table
- Parquet (zip)One Parquet file per table, zipped
- SQL scriptCREATE TABLE with primary and foreign keys, then INSERTs
- CSVA single CSV file
- JSONA single JSON file
How this data was generated
Synthetic data. Every row was generated: no real people, customers or companies are in this dataset.
Synthetic data generated by GoMask DataFactory from a relational blueprint: keys, links and rules are enforced in code, text columns are filled by a language model. No real people, companies or transactions.
- Data generated using GoMask DataFactory.
- Synthetic data mimics typical pharmacy operations.
- Includes product details, inventory snapshots, and sales transactions.
- Checked by an automated quality gate: unique keys, no orphan foreign keys, required columns filled, declared rules and date ranges (realism score 92).
Limitations
- The dataset is synthetic and does not represent actual sales or inventory.
- No customer information is included.
- Inventory snapshots are not real-time.
- Distributions and correlations are modelled, not measured from real records.
blueprint · pharmacy-dataset
Scale this dataset
Same tables. As many rows as you need.
Open the blueprint behind these 3 tables in Data Factory: keep the relationships, change a column, and generate it at the size you need.
- 200,000 rows
- 1,000,000 rows
- Tables
- products, inventory, sales
- Licence
- yours to use, including commercially
- API slug
- pharmacy-dataset