Pharmacy Inventory Sales Forecast

This dataset provides detailed historical sales and inventory records for top pharmacy products, including batch-level expiration and restock information, store locations, and transaction details. It enables precise inventory optimization, demand forecasting, and proactive management of product expirations across multiple pharmacy locations.

  • opened 59 times
  • last updated 29 Jul 2025
  • by GoMask
The brief that made it

Inventory optimization and automated restocking

Sample rows

preview · 8 of 200 rows · all 20 columns
sale_idstringstore_countrystringunit_pricefloatcategorystringproduct_idstringproduct_namestringmanufacturerstringbatch_numberstringexpiration_datedaterestock_datedateunits_in_stockintegerunits_soldintegersale_datedatetotal_sale_amountfloatstore_idstringstore_namestringstore_street_addressstringstore_citystringstore_statestringstore_postal_codestring
S00001USA7.99analgesicP1001Ibuprofen 200mgHealWell PharmaIBU-24A-0012025-11-152024-10-2012062024-11-0547.94ST001HealthFirst Pharmacy123 Market StSpringfieldIL62701
S00002USA12.75antibioticP1002Amoxicillin 500mgMediCore LabsAMX-23Q-0022026-01-132024-12-018532024-12-1038.25ST002Care Max200 Main AveRaleighNC27601
S00003USA8.5supplementP1003Vitamin D3 1000IUNutriHealth IncVD3-24B-0032026-02-202024-12-14200102025-01-0885ST003PharmaTrust450 Oak BlvdDenverCO80203
S00004USA14.25antihistamineP1004Cetirizine 10mgAllergyFree LtdCTZ-24C-0042025-09-302024-08-256022024-09-1228.5ST004WellnessMed789 3rd StAustinTX73301
S00005USA9.45supplementP1005Calcium 600mgNutriHealth IncCAL-24D-0052026-08-182025-07-309582025-08-1275.6ST005CityRx Pharmacy159 West LoopChicagoIL60607
S00006USA11.99antacidP1006Famotidine 20mgDigestive SolutionsFMT-23F-0062025-05-212024-04-1413052024-04-2059.95ST006ExpressRx456 Elm StPortlandOR97201
S00007USA39.5hormoneP1007Levothyroxine 88mcgEndoLife CorpLEV-23Y-0072025-10-102024-09-151812024-09-2839.5ST007SpecialtyRx210 Medical PkwyClevelandOH44114
S00008USA6.25analgesicP1008Aspirin 81mgHealWell PharmaASP-24A-0082026-04-222025-04-107542025-05-0125ST008MedCity Pharmacy321 Willow RdColumbusOH43215

What the 200 rows show

from the 200-row sample
  • 11.0median unit_price
  • 31store states
  • 45manufacturers
  • 52stores
  • 52store cities
  • 85.5median units_in_stock
store_country200 rows by value
0100200195USA98%5N/A3%
unit_price200 rows, in bands of 20
0901801731661102010100180unit_price →

Median 11.0, from 0.01 to 179.0.

category195 rows with a value · 5 left blank
  1. supplement44
  2. analgesic25
  3. antihistamine24
  4. antacid22
  5. hormone18
  6. antibiotic17
  7. other15
  8. vaccine10
  9. antihypertensive5
  10. bronchodilator3
20 columns by typefrom the column list below
  • string 13
  • integer 2
  • float 2
  • date 3

Columns

20 columns in three groups
blueprint · 20 columns
columntypedescriptionexample
Text 13 columns
sale_idstringUnique identifier for each sale transaction recorduniqueS00001
product_idstringUnique identifier for the pharmacy productP1001
product_namestringName of the pharmacy productIbuprofen 200mg
categorystringProduct category (e.g., analgesic, antibiotic, supplement)optionalanalgesic
manufacturerstringName of the product manufactureroptionalHealWell Pharma
batch_numberstringBatch or lot number for traceability and expiration trackingIBU-24A-001
store_idstringUnique identifier for the pharmacy location/storeST001
store_namestringName of the pharmacy location/storeoptionalHealthFirst Pharmacy
store_street_addressstringStreet address of the pharmacy locationoptional123 Market St
store_citystringCity where the pharmacy is locatedoptionalSpringfield
store_statestringState or province where the pharmacy is locatedoptionalIL
store_postal_codestringPostal or ZIP code of the pharmacy locationoptional62701
store_countrystringCountry where the pharmacy is located2 countries · optionalUSA
Numbers 4 columns
units_in_stockintegerNumber of units currently available in inventory at the time of sale0 or more120
units_soldintegerNumber of units sold in this transaction1 or more6
unit_pricefloatSale price per unit of the product0 or more7.99
total_sale_amountfloatTotal sale amount for the transaction (units_sold * unit_price)0 or more47.94
Dates and times 3 columns
expiration_datedateDate when the product batch expires2025-11-15
restock_datedateDate when the product was last restockedoptional2024-10-20
sale_datedateDate when the sale occurred2024-11-05

15 SQL practice questions for the Pharmacy Inventory Sales Forecast

Written for this data and checked against it: 12 SQL and 3 Power BI exercises from beginner to advanced. Try the first three free; the practice kit has all 15, a starter .sql file and an answer key with every expected result.

  1. 01BeginnerFreeSELECT · WHERE · ORDER BY

    High-volume sales

    Return sale_id, product_name and units_sold for every sale where units_sold is greater than 500. Sort by units_sold from highest to lowest, and break ties by sale_id in ascending order.

    Tables: pharmacy_inventory_sales_forecast · your result: 3 columns, 2 rows
  2. 02BeginnerFreeDISTINCT · WHERE · ORDER BY

    Distinct categories

    Return the distinct non-null category values as a single column named category, sorted alphabetically.

    Tables: pharmacy_inventory_sales_forecast · your result: 1 columns, 18 rows
  3. 03BeginnerFreeGROUP BY · COUNT

    Sales count per state

    For each non-null store_state, return store_state and the number of sales as sales_count. Sort by sales_count from highest to lowest, then by store_state in ascending order.

    Tables: pharmacy_inventory_sales_forecast · your result: 2 columns, 31 rows
  1. 04Revenue per categoryBeginner
  2. 05Total units sold cardsPower BI
  3. 06Categories with many salesIntermediate
  4. 07Stock level bucketsIntermediate
  5. 08Sales above average amountIntermediate
  6. 09Monthly revenue by sale monthIntermediate
  7. 10Manufacturers above average pricePower BI
  8. 11Top product by revenue per categoryAdvanced
  9. 12Running revenue totalAdvanced
  10. 13Gap since previous sale per productAdvanced
  11. 14Share of revenue by stateAdvanced
  12. 15Revenue percent of total by categoryPower BI

Get the practice kit: the full dataset, all 15 exercises, a starter .sql and the answer key. One-time $3.99.

Get the practice kit · $3.99

Use it for

  • median unit pr…11.0200 rowsmean unit price by st…16.3USA0.01N/A

    A healthcare dashboard

    Unit_price by store_country and a breakdown of category. Excel, Power BI or Tableau.

  • What pattern can you find in 200 rows?

    A class exercise

    Hand out the rows and one question. Everyone works from the same 200 rows.

  • A software demo

    Believable sales with product_id, product_name and category to fill a screen in front of a buyer.

Not quite right?

Make it yours.

Same 20 columns, your size and your rules. See 20 rows before you pay.

Preview 20 rows free

1,000 rows: $1.99 · 10,000: $12.99One-time. No subscription. All prices

This dataset200 rows20 columns
Yours1,000 rows20 columnsstore_street_address: UK only

blueprint · pharmacy-inventory-sales-forecast

Behind this dataset

Same schema. As many rows as you need.

These 200 rows came out of a blueprint — 20 columns with generation rules behind each one. Open it in Data Factory to retune a column, add your own, wire in foreign keys, and run it at the size you actually need.

Rules it was built with
  • Sales units per SKU per week
  • Include restock and expiration dates
  • Flag items with recurring stockouts
  • Exclude controlled substances
Rows
Open the blueprint in Data Factory

1 credit per row. Preview 20 rows free. Buy rows for the full run.

Exports
CSV, JSON, JSONL, Parquet, SQL, Excel, TSV, XML
Licence
yours to use, including commercially
API slug
pharmacy-inventory-sales-forecast

What should your data show?

Preview 20 rows free
No signup. No card.