DBI202Xuất hiện trong 1 đề thi
Given the table 'Orders(order_id, customer_id, amount)', which SQL query returns the customer with the lowest total order amount?
Các lựa chọn
Asql\nSELECT TOP 1 customer_id FROM Orders GROUP BY customer_id ORDER BY SUM(amount) DESC;
Bsql\nSELECT TOP 1 customer_id FROM Orders GROUP BY customer_id ORDER BY SUM(amount);
Csql\nSELECT customer_id FROM Orders WHERE amount = MIN(amount);
Dsql\nSELECT customer_id, MAX(amount) FROM Orders;