Best-Selling Dish
Return the dish name with the highest total quantity ordered, and the quantity.
Table schema
Dishes(id INT PRIMARY KEY, restaurant_id INT, name VARCHAR(20))
OrderLines(order_id INT, dish_id INT, qty INT)Sample data
Dishes
id | restaurant_id | name
1 | 1 | Pizza
2 | 1 | Pasta
3 | 2 | Burger
4 | 2 | Fries
OrderLines
order_id | dish_id | qty
1 | 1 | 2
1 | 2 | 1
2 | 1 | 1
3 | 3 | 4
4 | 4 | 1
5 | 3 | 1
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.