← All SQL interview questions

Warehouse stock summary

EasyAggregate FunctionsWalmartAmazon

Supply chain planners need a one-line health check per warehouse before the festive restock.

From warehouse_stock, return one row per warehouse_code with:

  • sku_count — number of SKUs stocked
  • total_units — total units on hand
  • avg_unit_price — average unit price rounded to 2 decimals
  • min_units and max_units — smallest and largest unit count for that warehouse

Sample data

Table: warehouse_stock

14 row(s) · showing first 8

stock_idINTwarehouse_codeTEXTskuTEXTunitsINTunit_priceNUMERIC(10,2)
1WH-NORTHSKU-1001120249.50
2WH-NORTHSKU-1002401299.00
3WH-NORTHSKU-100331089.99
4WH-NORTHSKU-100475549.25
5WH-WESTSKU-1001200249.50
6WH-WESTSKU-1005153499.00
7WH-WESTSKU-100648035.75
8WH-SOUTHSKU-1002901299.00

Practising alone only goes so far — our live cohorts pair SQL depth with dashboards, agentic analytics projects and mock interviews.

Explore the program