OCP-1Z0-051 第8题 子查询和多表关联查询和情况

一、原题

 View the Exhibit and examine the structure of the CUSTOMERS table.

Which two tasks would require subqueries or joins to be executed in a single statement? (Choose two)
 
A. listing of customers who do not have a credit limit and were born before 1980
B. finding the number of customers, in each city, whose marital status is 'married'
C. finding the average credit limit of male customers residing in 'Tokyo' or 'Sydney'
D. listing of those customers whose credit limit is the same as the credit limit of customers residing in the city 'Tokyo’.
E. finding the number of customers, in each city, whose credit limit is more than the average credit limit of all the customers.


答案  DE

二、题目翻译
下面是CUSTOMERS表的结构:
以下哪两个需求需要在一条语句中执行子查询或表关联查询?(选择两个)
A. 列出没有信贷限额并且1980年以前出生的客户。
B. 找出每个城市的已婚客户的数量。
C. 找出住在'Tokyo'或者 'Sydney'两个城市的男性客户的平均信贷限额。
D. 列出与住在'Tokyo'的客户的信贷限额相等的客户。
E. 找出每个城市信贷限额大于所有客户的平均信贷限额的客户数量

三、题目解析
A选项,只需要在where条件中判断有没有信贷限额和出生日期小于1980的人,两个条件and连接就行了,不需要子查
              询或多表关联。

B选项,只需要在where条件过滤是否结婚就可以了,也不需要使用子查询或关联查询。
C选项,用where过滤两个城市,并且性别是男的客户,然后求平均信贷额,也不需要用子查询或关联查询。
D选项,首先要用子查询查出Tokyo这个客户的信贷限额,然后才能求出哪个用户与他的相等。
E选项,首先要用子查询查出客户的平均信贷额,然后才能求出哪些用户的信贷额大于平均信贷额。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值