OCP-1Z0-051 第125题 self-join(自连接)和self-join(子查询)

时间:2022-12-27 19:18:26
一、原题
Examine the structure of the CUSTOMERS table:
Name            Null             Type
CUSTNO         NOT NULL       NUMBER(3)
CUSTNAME       NOT NULL       VARCHAR2(25)
CUSTADDRESS                   VARCHAR2(35)
CUST_CREDIT_LIMIT             NUMBER(5)
CUSTNO is the PRIMARY KEY in the table. You want to find out if any customers' details have been entered more than once using different CUSTNO, by listing all the duplicate names.
Which two methods can you use to get the required result? (Choose two.)
A. self-join
B. subquery
C. full outer-join with self-join
D. left outer-join with self-join
E. right outer-join with self-join

答案:AB

二、题目翻译
查看CUSTOMERS表的结构
CUSTNO是表的主键,想找到是否存在客户信息使用不同的CUSTNO录入了多次,显示所有重复的客户名称.
哪两个方法可以获取所需结果?

三、题目解析
需要用自连接查出被多次录入的客户的详细信息,
需要用子查询查出重复的客户。

表连接的用法,详见:
       
http://blog.csdn.net/holly2008/article/details/25704471