Inventory Management Dataset for SQL
This ready-made dataset provides 28,111 records across 4 tables for inventory management analysis. Practice your SQL skills by querying stock levels, transaction history, and product details. A free sample is available, with full download requiring credits.
At a glance
- 4tables
- 28,111rows
- 18columns
- Jan 2023 – Jun 2024date range
The 4 tables
preview and data dictionary per tableProducts products · table · 3,000 rows
Contains details about each product.
Preview
| product_iduuid | product_namestring | categorystring | unit_pricedecimal |
|---|---|---|---|
| 32f34a49-c967-40a3-8abe-6e6e5b1ea5cd | Gaming Mousepad | Accessories | 37.49 |
| a0f0ed83-452f-44f7-83ad-bc956bf5f19e | Keyboard | Accessories | 57.67 |
| d8432a4f-79ea-46f9-96b6-5db31fd8b892 | Keyboard | Accessories | 104.23 |
| 1b237f0c-2eba-4efb-8c39-e9fefe5de53d | Keyboard | Accessories | 34.16 |
| f9047d40-38b0-4657-8082-0351595ef365 | USB-C Hub | Accessories | 41.23 |
| 15c71fb0-8c81-4641-ad48-95bfb4b35f2e | USB-C Hub | Accessories | 28.45 |
| b433a0d8-dc39-42e7-a9fd-05e03985b603 | Gaming Mousepad | Accessories | 46.48 |
| d139506e-c3eb-46c9-b49f-d1d1d2056eac | Keyboard | Accessories | 74.22 |
| 81e07aee-9101-4219-970a-43f44c4eeeb3 | Keyboard | Accessories | 117.71 |
| 6e92e8dd-1e78-48d9-bce1-49edf973b037 | Gaming Mousepad | Accessories | 48.79 |
Data dictionary
| column | type | description | example | null % |
|---|---|---|---|---|
product_ | uuid | Unique primary key identifier for each product.unique | 32f34a49-c967-40a3-8abe-6e6e5b1ea5cd | 0% |
product_ | string | Commercial name or description of the product. | Gaming Mousepad | 0% |
category | string | General product classification category. | Accessories | 0% |
unit_ | decimal | Individual unit sales price in USD. | 37.49 | 0% |
Warehouses warehouses · dimension table · 10 rows
Lists the different warehouse facilities.
Preview
| warehouse_iduuid | warehouse_namestring | locationstring |
|---|---|---|
| 9752f3b8-ede2-4c43-9ac6-060272b9560d | Warehouse B | Los Angeles |
| 7dc1a762-77e3-485f-b78c-d37b63630e3a | Warehouse D | Houston |
| 95d9af03-3ff2-49a4-b1ac-109c47630aa1 | Warehouse A | New York |
| ca737810-76b5-4045-ad9f-b926d4ef9971 | Warehouse C | Chicago |
| 0b189bdb-8dfb-473e-b841-3eb2b5ef2e8a | Warehouse H | San Diego |
| b55ee987-d8c1-4015-9db0-a94cb70cf428 | Warehouse E | Phoenix |
| e7b4d5ca-e3e7-41af-9ed7-c0dcaa2785c5 | Warehouse F | Philadelphia |
| bdd2dce3-c35e-4048-a178-833dd7aa3317 | Warehouse G | San Antonio |
| a635a6a6-4f20-467e-9a5b-37639aa28d37 | Warehouse I | Dallas |
| 12d113ae-c1e0-4667-9949-40ada73c9ea5 | Warehouse J | San Jose |
Data dictionary
| column | type | description | example | null % |
|---|---|---|---|---|
warehouse_ | uuid | Unique identifier for the warehouse facility.unique | 9752f3b8-ede2-4c43-9ac6-060272b9560d | 0% |
warehouse_ | string | Standardized lettered name of the warehouse facility.unique | Warehouse B | 0% |
location | string | Metropolitan area where the warehouse is physically established.unique | Los Angeles | 0% |
Inventory levels inventory_levels · fact table · 16,121 rows
Tracks the stock quantity of products in each warehouse.
Preview
| inventory_iduuid | stock_quantityinteger | last_updateddatetime | product_iduuid | warehouse_iduuid |
|---|---|---|---|---|
| 36bc9d28-adbd-4d84-a438-15ebf970e847 | 500 | 2023-05-29 11:55:10 | b433a0d8-dc39-42e7-a9fd-05e03985b603 | 0b189bdb-8dfb-473e-b841-3eb2b5ef2e8a |
Data dictionary
| column | type | description | example | null % |
|---|---|---|---|---|
inventory_ | uuid | Primary key uniquely identifying each inventory level record. | 298e8d3d-78a5-4b73-b507-183e963baeff | 0% |
stock_ | integer | Current on-hand stock quantity of the product at this warehouse facility. | 67 | 0% |
last_ | datetime | Timestamp indicating the last time stock levels were verified or updated in this warehouse. | 2024-04-30 13:45:33 | 0% |
product_ | uuid | Foreign key to products.product_id. | d7c2f952-9511-4923-ab38-af65c1720b42 | 0% |
warehouse_ | uuid | Foreign key to warehouses.warehouse_id. | ca737810-76b5-4045-ad9f-b926d4ef9971 | 0% |
Transactions transactions · fact table · 8,980 rows
Records all stock movements into and out of warehouses.
Preview
| transaction_iduuid | transaction_typestring | quantityinteger | transaction_datedatetime | product_iduuid | warehouse_iduuid |
|---|---|---|---|---|---|
| f4cfb739-a559-43e9-b132-fdc50c011e75 | OUT | 1 | 2024-01-24 06:35:03 | e0e5c109-f196-4eb5-85b7-e4f70419f044 | 95d9af03-3ff2-49a4-b1ac-109c47630aa1 |
| 66b14d89-ae7e-4c9d-8b85-0bfbeb8d4a9d | OUT | 1 | 2023-06-15 14:10:06 | 62aa5f32-25e9-4eab-85dd-47284f24c62e | ca737810-76b5-4045-ad9f-b926d4ef9971 |
| 9e6eff5d-47c2-4599-9fad-1dcb89bd97f0 | OUT | 2 | 2023-06-28 09:43:49 | 3e4bb0d4-a55e-437f-aebe-bee16fc02315 | ca737810-76b5-4045-ad9f-b926d4ef9971 |
| c9dc3332-8453-44d4-a24a-5fe2d9be1d85 | OUT | 1 | 2023-09-17 08:04:10 | a7a18fe9-8c05-4b29-816d-4708d1f29756 | 95d9af03-3ff2-49a4-b1ac-109c47630aa1 |
| 2b309215-c8a8-48b9-89d6-c4b40698f6f2 | OUT | 19 | 2023-02-21 14:16:37 | 597e6ff3-21ef-4fca-af75-1407cfe71201 | 95d9af03-3ff2-49a4-b1ac-109c47630aa1 |
| be108952-f81a-4565-9970-ec007bfadffa | OUT | 16 | 2024-06-10 09:45:20 | ced0c9ab-842d-475d-b3b1-e53786ffc0e0 | 0b189bdb-8dfb-473e-b841-3eb2b5ef2e8a |
| bf43d177-005e-4aff-b270-f97494fbc0de | OUT | 7 | 2024-06-07 13:11:58 | 05149360-2575-497d-908a-59b936c53444 | 9752f3b8-ede2-4c43-9ac6-060272b9560d |
| 9f7e168e-5196-40dc-942e-9d36d1e01a4b | OUT | 7 | 2023-04-12 12:38:26 | 54a6a12c-6b93-45d9-847d-e35f63f004ef | 7dc1a762-77e3-485f-b78c-d37b63630e3a |
| a762151a-bf05-4b4a-a6b7-64793dc74869 | OUT | 8 | 2024-05-02 13:33:16 | d40bc8e3-ba0b-4e2d-8fdd-441897bc5712 | 0b189bdb-8dfb-473e-b841-3eb2b5ef2e8a |
| 9a419446-7034-49ca-b9a9-ff9e363d82c5 | OUT | 3 | 2023-08-10 10:26:57 | 6571a2cb-c78b-441d-800e-0b7e1ab7b1d1 | 0b189bdb-8dfb-473e-b841-3eb2b5ef2e8a |
Data dictionary
| column | type | description | example | null % |
|---|---|---|---|---|
transaction_ | uuid | Unique identifier for the inventory transaction record. | f4cfb739-a559-43e9-b132-fdc50c011e75 | 0% |
transaction_ | string | Direction of stock movement (IN for inbound replenishment, OUT for outbound dispatch). | OUT | 0% |
quantity | integer | Number of product units transferred in the transaction. | 1 | 0% |
transaction_ | datetime | Timestamp indicating when the inventory transaction took place. | 2024-01-24 06:35:03 | 0% |
product_ | uuid | Foreign key to products.product_id. | e0e5c109-f196-4eb5-85b7-e4f70419f044 | 0% |
warehouse_ | uuid | Foreign key to warehouses.warehouse_id. | 95d9af03-3ff2-49a4-b1ac-109c47630aa1 | 0% |
How the tables join
inventory_levels.product_id references products.product_idmany to one: each Inventory levels row points to one Products rowinventory_levels.warehouse_id references warehouses.warehouse_idmany to one: each Inventory levels row points to one Warehouses rowtransactions.product_id references products.product_idmany to one: each Transactions row points to one Products rowtransactions.warehouse_id references warehouses.warehouse_idmany to one: each Transactions row points to one Warehouses row
Questions to answer with it
Write a SQL query to identify products that have not had any outgoing transactions in the last 90 days.
Filter transactions by type and date, then find products not present in the result.
tables: products, transactions
Write a SQL query to calculate the total stock quantity for each product across all warehouses.
Join products and inventory_levels, then group by product and sum the quantity.
tables: products, inventory_levels
Write a SQL query to find the average stock quantity per warehouse for each product category.
Join all three tables, group by category and warehouse, then calculate the average stock quantity.
tables: products, inventory_levels, warehouses
Write a SQL query to list all products and their total stock quantity, showing 0 if a product has no inventory records.
Use a LEFT JOIN from products to inventory_levels and sum quantities, handling NULLs.
tables: products, inventory_levels
Starter SQL
run against this data before publishingTable names match the SQLite file and the SQL script.
Total Stock Quantity Per Product
SELECT p.product_name, SUM(il.stock_quantity) AS total_stock
FROM products p
JOIN inventory_levels il ON p.product_id = il.product_id
GROUP BY p.product_name
ORDER BY total_stock DESC
LIMIT 20;Products with No Outgoing Transactions in 90 Days
SELECT p.product_name
FROM products p
LEFT JOIN (
SELECT DISTINCT product_id
FROM transactions
WHERE transaction_type = 'OUT' AND transaction_date >= DATE('now', '-90 day')
) AS recent_outbound ON p.product_id = recent_outbound.product_id
WHERE recent_outbound.product_id IS NULL
LIMIT 20;Average Stock Quantity by Category and Warehouse
SELECT w.warehouse_name, p.category, AVG(il.stock_quantity) AS average_stock
FROM warehouses w
JOIN inventory_levels il ON w.warehouse_id = il.warehouse_id
JOIN products p ON il.product_id = p.product_id
GROUP BY w.warehouse_name, p.category
ORDER BY w.warehouse_name, p.category
LIMIT 20;Product Stock Quantity with 0 for No Inventory
SELECT p.product_name, COALESCE(SUM(il.stock_quantity), 0) AS total_stock
FROM products p
LEFT JOIN inventory_levels il ON p.product_id = il.product_id
GROUP BY p.product_name
ORDER BY p.product_name
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")
warehouses = pd.read_csv("warehouses.csv")
inventory_levels = pd.read_csv("inventory_levels.csv")
transactions = pd.read_csv("transactions.csv")
# Join inventory_levels to products
df = inventory_levels.merge(products, left_on="product_id", right_on="product_id", how="left", suffixes=("", "_products"))
print(df.groupby("product_name").size().sort_values(ascending=False))Using it in your tool
- SQL
- The dataset is available as an SQLite database file. You can load this file into any SQLite-compatible tool or convert it to other SQL formats. Primary keys and foreign keys are defined to facilitate joins between tables.
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 was generated using GoMask DataFactory.
- Includes synthetic product, warehouse, inventory, and transaction records.
- Relationships between tables are maintained via foreign keys.
- 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 data is synthetic and does not represent real-world inventory movements.
- Specific details like supplier information or detailed product specifications are not included.
- Distributions and correlations are modelled, not measured from real records.
blueprint · inventory-management-dataset-for-sql
Scale this dataset
Same tables. As many rows as you need.
Open the blueprint behind these 4 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, warehouses, inventory_levels, transactions
- Licence
- yours to use, including commercially
- API slug
- inventory-management-dataset-for-sql