Skip to content
cccskills
FreePublished on GitHub

inventory_management

Use a defined database structure and business rules to query products, warehouses, stock levels, and stock movements. It supports inventory checks and SQL for identifying products whose combined warehouse stock has reached the reorder threshold.

OriginalShow the original description

Database schema and business logic for inventory tracking including products, warehouses, and stock levels.

See how to install

Good for

  • Checking stock quantities by product and warehouse
  • Finding products at or below their reorder threshold
  • Understanding records for stock movements
  • Excluding discontinued products from routine analysis

Files included (1)

  • SKILL.md1.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Inventory Management Schema

Tables

products

  • product_id (PRIMARY KEY)
  • product_name
  • sku
  • category
  • unit_cost
  • reorder_point (minimum stock level before reordering)
  • discontinued (boolean)

warehouses

  • warehouse_id (PRIMARY KEY)
  • warehouse_name
  • location
  • capacity

inventory

  • inventory_id (PRIMARY KEY)
  • product_id (FOREIGN KEY -> products)
  • warehouse_id (FOREIGN KEY -> warehouses)
  • quantity_on_hand
  • last_updated

stock_movements

  • movement_id (PRIMARY KEY)
  • product_id (FOREIGN KEY -> products)
  • warehouse_id (FOREIGN KEY -> warehouses)
  • movement_type (inbound/outbound/transfer/adjustment)
  • quantity (positive for inbound, negative for outbound)
  • movement_date
  • reference_number

Business Logic

Available stock: quantity_on_hand from inventory where quantity_on_hand > 0

Products needing reorder: total quantity_on_hand across warehouses <= product's reorder_point

Active products only: Exclude discontinued = true unless analyzing discontinued items

Example Query

-- Find products below reorder point
SELECT p.product_id, p.product_name, p.reorder_point, SUM(i.quantity_on_hand) as total_stock
FROM products p
JOIN inventory i ON p.product_id = i.product_id
WHERE p.discontinued = false
GROUP BY p.product_id, p.product_name, p.reorder_point
HAVING SUM(i.quantity_on_hand) <= p.reorder_point;

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

sales_analytics

FreeSummary

Use defined customer and order tables to build sales analysis queries with consistent business rules. Calculate revenue from completed orders, rank customers by spending, and identify high-value orders using the supplied thresholds and SQL example.

  • Ranking the top ten customers by revenue over three months
  • Calculating revenue from completed orders
  • Finding orders with a total amount above 1,000
alibaba/spring-ai-alibaba11KUpdated Oct 7, 2026

See all skills by alibaba

Report a problem with this skill