ExaminethedatafromtheORDERSandCUSTOMERStables. ORDERS ORD_IDORD_DATECUST_ID 12-JAN- 1001510000 09-MAR- 101408000 09-MAR- 1023512500 15-MAR- 1031512000 25-JUN- 104156000 18-JUL- 105205000 10618-JUL-357000 21-JUL- 107206500 04-AUG- 109108000 CUSTOMERS CUST_IDCUST_NAMECITY 10SmithLosAngeles 15BobSanFrancisco 20MartinChicago 25MaryNewYork 30RinaChicago 35SmithNewYork 40LindNewYork EvaluatetheSQLstatement: SELECT* FROMorders WHEREcust_id=(SELECTcust_id FROMcustomers WHEREcust_name='Smith'); Whatistheresultwhenthequeryisexecuted?() A: ORD_IDORD_DATECUST_IDORD_TOTAL09-MAR-102351250018-JUL-10635700004-AUG-108108000 B: ORD_IDORD_DATECUST_IDORD_TOTAL09-MAR-102351250018-JUL-106357000 C: ORD_IDORD_DATECUST_IDORD_TOTAL04-AUG-108108000 D: Thequeryfailsbecausethesubqueryreturnsmorethanonerow. E: Thequeryfailsbecausetheouterqueryandtheinnerqueryareusingdifferenttables.
ExaminethedatafromtheORDERSandCUSTOMERStables. ORDERS ORD_IDORD_DATECUST_ID 12-JAN- 1001510000 09-MAR- 101408000 09-MAR- 1023512500 15-MAR- 1031512000 25-JUN- 104156000 18-JUL- 105205000 10618-JUL-357000 21-JUL- 107206500 04-AUG- 109108000 CUSTOMERS CUST_IDCUST_NAMECITY 10SmithLosAngeles 15BobSanFrancisco 20MartinChicago 25MaryNewYork 30RinaChicago 35SmithNewYork 40LindNewYork EvaluatetheSQLstatement: SELECT* FROMorders WHEREcust_id=(SELECTcust_id FROMcustomers WHEREcust_name='Smith'); Whatistheresultwhenthequeryisexecuted?() A: ORD_IDORD_DATECUST_IDORD_TOTAL09-MAR-102351250018-JUL-10635700004-AUG-108108000 B: ORD_IDORD_DATECUST_IDORD_TOTAL09-MAR-102351250018-JUL-106357000 C: ORD_IDORD_DATECUST_IDORD_TOTAL04-AUG-108108000 D: Thequeryfailsbecausethesubqueryreturnsmorethanonerow. E: Thequeryfailsbecausetheouterqueryandtheinnerqueryareusingdifferenttables.
有订单表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
有订单表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
【单选题】假设订单表 orders 用于存储订单信息, cid 代表客户编号, money 代表单次订购额,现要查询每个客户的订购次数和每个客户的订购总金额,则下列() SQL 语句可以返回正确的结果。 A. select cid,count(distinct(cid)),sum(money) from ordersgroup by cid B. select cid , count(distinct(cid)) , sum(money) fromorders order by cid C. select cid , count(cid) , sum(money) from orders orderby cid D. select cid , count(cid) , sum(money) from orders groupby cid
【单选题】假设订单表 orders 用于存储订单信息, cid 代表客户编号, money 代表单次订购额,现要查询每个客户的订购次数和每个客户的订购总金额,则下列() SQL 语句可以返回正确的结果。 A. select cid,count(distinct(cid)),sum(money) from ordersgroup by cid B. select cid , count(distinct(cid)) , sum(money) fromorders order by cid C. select cid , count(cid) , sum(money) from orders orderby cid D. select cid , count(cid) , sum(money) from orders groupby cid