Best Seller by Gross Sales
Easy
Marketplace Sellers
Return the seller with the highest gross sales (all rows, refunds included) and the total.
Table schema
Sellers(id INT PRIMARY KEY, name VARCHAR(10), joined DATE)
Sales(id INT PRIMARY KEY, seller_id INT, amount INT, refunded INT)Sample data
Sellers
id | name | joined
1 | ShopA | 2025-01-01
2 | ShopB | 2025-06-01
3 | ShopC | 2026-02-01
Sales
id | seller_id | amount | refunded
1 | 1 | 100 | 0
2 | 1 | 200 | 1
3 | 2 | 150 | 0
4 | 2 | 50 | 0
5 | 2 | 70 | 1
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.