一、原题

 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)
 ocp-051-8_ocp-051-8
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选项,首先要用子查询查出客户的平均信贷额,然后才能求出哪些用户的信贷额大于平均信贷额。