数据表如图所示,列出客户订单总金额大于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 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
举一反三
- 若按天计算每个客户的订单总金额,正确的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
- 有订单表Orders,它的数据如下图所示。列出客户订单总金额大于3000的数据,正确的是() A: SELECTID,SUM(OrderAmount)FROMORDERSgroupbyIDhavingsum(OrderAmount)>3000 B: SELECTID,SUM(OrderAmount)FROMORDERSwheresum(OrderAmount)>3000 groupbyID C: SELECTID,SUM(OrderAmount)FROMORDERSwheresum(OrderAmount)>3000 D: SELECTID,SUM(OrderAmount)FROMORDERS groupbyID wheresum(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
- 以下命令可以查询date_records中约会成功匹配(match=1)次数的是() A: SELECT sum(match) FROM date_records; B: SELECT count() FROM date_records WHERE match=1; C: SELECT sum(id) FROM date_records WHERE match=1; D: SELECT match FROM date_records WHERE match=1;