0

Write an SQL statement to show the SKU and SKU_Description of the item ordered the most frequently (most orders, not most total quantity).

I tried that but I did not get the right answer ( compared when I did it manually)

SELECT order_item.SKU,SKU_Description,COUNT(order_item.SKU) as 'Value'
FROM Order_Item
INNER JOIN SKU_Data
ON Order_Item.SKU=SKU_Data.SKU
GROUP BY order_item.SKU,SKU_Description
Order by 'Value' DESC
Limit 1;

Here the different tables available

Inventory (WarehouseID,SKU,SKU_Description,QuantityOnHand,QuantityOnOrder)

Order_Item(OrderNumber,SKU,Quantity,Price,ExtendedPrice)

Retail_order(OrderNumber,StoreNumber,StoreZip,OrderMonth,OrderYear,OrderTotal)

SKU_Data(SKU,SKU_Description,Department,Buyer)

Warehouse(WarehouseCity,WarehouseState,Manager,SquareFeet)
Talha
  • 524
  • 1
  • 6
  • 22
Eileen
  • 21
  • 3

0 Answers0