Every panel below is the result set of a literal SQL statement executed by the in-browser engine against products â stock_movements. Edit a query in the SQL console and the analytics follow.
Filter by category, status or free text. Stock levels are maintained exclusively through logged movements â direct edits are written as adjustment transactions.
Every receipt, issue and count correction lands here. The ledger feeds the low-stock alerts, the 30-day history query and the top-sellers ranking.
A working SELECT engine: SELECT · FROM · JOINâ¦ON · WHERE · GROUP BY · HAVING · ORDER BY · LIMIT, aggregates (SUM/COUNT/AVG/MIN/MAX), arithmetic, DATE_SUB(NOW(), INTERVAL n DAY), LIKE, IN and BETWEEN.
The four required analytics queries are registered below exactly as specified, executed by the engine on every data change.
stock_movements.product_id â products.product_id (many-to-one). All JOINs in Q3/Q4 use this key.
current_stock is a materialised running total. It is mutated only by:
Indexes recommended for the workload:
Engine limitations: subqueries, UNION and window functions are parsed as unsupported and reported as clean errors rather than silently ignored.