若按天计算每个客户的订单总金额,正确的SQL是________。[img=1101x418]17de922ac4b9078.png[/img]
A: SELECT C_ID,COUNT(OrderPrice)FROM Orders GROUP BY C_ID,OrederDate
B: SELECT OrderDate,C_ID,SUM(OrderPrice)FROM Orders GROUP BY OrderDate
C: SELECT OrderDate,C_ID,SUM(OrderPrice)FROM Orders GROUP BY OrderDate,C_ID
D: SELECT OrderDate,SUM(OrderAmount)FROM Orders GROUP BY OrderDate,C_ID
A: SELECT C_ID,COUNT(OrderPrice)FROM Orders GROUP BY C_ID,OrederDate
B: SELECT OrderDate,C_ID,SUM(OrderPrice)FROM Orders GROUP BY OrderDate
C: SELECT OrderDate,C_ID,SUM(OrderPrice)FROM Orders GROUP BY OrderDate,C_ID
D: SELECT OrderDate,SUM(OrderAmount)FROM Orders GROUP BY OrderDate,C_ID
举一反三
- 数据表如图所示,列出客户订单总金额大于3000的数据,正确的SQL是________[img=1101x418]1803c6faf3915a8.png[/img] A: SELECT C_ID,SUM(OrderAmount) FROM Orders GROUP BY C_ID HAVING SUM(OrderAmount)>3000 B: SELECT C_ID,SUM(OrderAmount) FROM Orders WHERE SUM (OrderAmoount)>3000 GROUP BY C_ID C: SELECT C_ID,SUM(OrderAmount) FROM Orders WHERE SUM (OrderAmoount)>3000 D: SELECT C_ID,SUM(OrderAmount) FROM Orders GROUP BY C_ID WHERE SUM(OrderAmount)>3000
- 统计每个部门中人数的语句是? A: select count(id) from emp order by deptno; B: select sum(id) from emp order by deptno; C: select count(id) from emp group by deptno; D: select sum(id) from emp group by deptno;
- 统计每个部门中的人数的语句是【】。 A: SELECT SUM(ID) FROM examp GROUP BY DE_NUM B: SELECT COUNT(ID) FROM examp ORDER BY DE_NUM C: SELECT COUNT(ID) FROM examp GROUP BY DE_NUM D: SELECT SUM(ID) FROM examp ORDER BY DE_NUM
- 有订单表orders,包含用户信息userid,产品信息productid,以下能够返回至少被订购过两次的productid的SQL语句是()。 A: SELECT productid FROM orders WHERE COUNT(productid)>;1; B: SELECT productid FROM orders WHERE MAX(productid)>;1; C: SELECT productid FROM orders WHERE having COUNT(productid)>;1 GROUP BY productid; D: SELECT productid FROM orders GROUP BY productid HAVING COUNT(porductid)>;1;
- 有订单表如下: 订单(订单号(C,4),客户号(C,4),职员号(C,3),签订日期(D),金额(N,6,2)) 查询每个客户的总金额信息的正确SQL语句是______。 A: SELECT 订单号,SUM(金额) FROM 订单 GROUP BY 客户号 B: SELECT 订单号,SUM(金额) FROM 订单 ORDER BY 客户号 C: SELECT 客户号,SUM(金额) FROM 订单 GROUP BY 客户号 D: SELECT 客户号,SUM(金额) FROM 订单 ORDER BY 客户号