OCP-1Z0-051 第八題

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

Answer:DE

翻譯:

查看客戶表的結構,回答下面的問題:

哪兩個查詢請求需要在一條語句中執行子查詢或者多表連接查詢?(選擇兩個)

A.列出沒有信貸限額且出生於1980年以前的客戶

B.找出每個城市已婚客戶的數量

C.找出住在東京和悉尼兩個城市中男性客戶的信貸限額平均值

D.找出居住在東京的信貸限額相等的客戶

E.找出每個城市信貸限額大於所有客戶平均信貸限額的客戶數量

解析:

A選項,在where條件中判斷有無信貸限額且出生於1980年以前的人

B選項,只需在where條件中過濾已婚客戶

C選項,在where條件中過濾兩個城市,男性客戶,然後再select中用avg函數求平均值就行。

D選項,首先使用子查詢找到居住在東京的客戶的信貸的限額,再找出和這個信貸限額相等的客戶的

E選項,首先使用子查詢找出所有客戶的平均信貸限額,然後再找出哪些用戶的信貸限額大於這個平均值。
推薦閱讀:

零基礎如何學習SQL——了解select查詢語句
mysql表中查找和小於某個數的所有最前面的記錄?
SQL優化器原理 - Auto Hash Join
誰有精簡的SQLSerVer安裝包,聽說有一種只有28M?
win7如何安裝SQL資料庫2000?

TAG:Oracle資料庫 | SQL | ocp認證 |