单项选择题
某玩具公司销售数据库有两个表,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) -
单项选择题
某公司的员工费用应用程序有两表,一个是EMP,包含所有员工数据,一个是EXPENSE,包含公司每个员工提交的费用票据。下列哪个查询取得提交的费用总和超过其工资值的员工ID与姓名?()
A.select e.empno,e.ename from emp e where e.sal <(select sum(x.vouch_amt)from expense x)and x.empno =e.empno;
B.select e.empno,e.ename from emp e where e.sal <(select x.vouch_amt from expense x where x.empno =e.empno);
C.select e.empno,e.ename from emp e where e.sal <(select sum(x.vouch_amt)from expense x where x.empno =e.empno);
D.select e.empno,e.ename from emp e where exists (select sum(x.vouch_amt)from expense x where x.empno =e.empno);