单项选择题
下列代码块显示的查询包含一个子查询:
可以用下列哪个子句重新定义这个查询,删除子查询与主查询中组函数执行的重复?()
A.group by
B.order by
C.with
D.having
相关考题
-
单项选择题
某玩具公司销售数据库有两个表,PROFITS存储不同地区不同季度的产品销售利润,REGIONS存储每个部门地区名称、该地区总部地址和该地区副总裁姓名。下列哪个查询取得SMITHERS、FUJIMORI与LIKKARAJU领导的地区的玩具销售利润?()
A.select sum(profit)from profits where region in (select region froms regions where reg_head in (‘SMITHERS’,‘FUJMORI’,‘LAKKARAJU’))and product =’TOYS’;
B.select sum(profit)from profits where region like (select region froms regions where reg_head in (‘SMITHERS’,‘FUJMORI’,‘LAKKARAJU’)and product =’TOYS’);
C.select sum(profit)from profits where region =(select region froms regions where reg_head in (‘SMITHERS’,‘FUJMORI’,‘LAKKARAJU’))and product =’TOYS’;
D.select sum(profit)from profits where region is (select region froms regions where reg_head in (‘SMITHERS’,‘FUJMORI’,‘LAKKARAJU’))and product =’TOYS’; -
单项选择题
用下列代码块回答问题:上述语句使用下面哪种子查询?()
A.单行子查询
B.多行子查询
C.from子句子查询
D.多列子查询 -
单项选择题
下列语句:下列哪个SQL语句产生与上面相同的输出,改写成使用运算符?()
A.select e.ename from emp e where exists(select x.empno from expense x where x.vouch_amt>10000)and x.empno =e.empno;
B.select e.ename from emp e where exists(select x.empno from expense x where x.vouch_amt>10000and x.empno =e.empno);
C.select e.ename from emp e where x.empno =e.empno and exists(select x.empno from expense x where x.vouch_amt>10000)
D.select e.ename from emp e,expense x where x.empno =e.empno and x.vouch_amt>10000and exists(select x.empno from expense x where)