QuestionQ31

VerifiedReporting Aggregated Data Using the Group Functions

Review the definition of the CUSTOMERS table:

Question Image

CUSTNO is the PRIMARY KEY.

You need to determine whether any customer details were entered more than once under a different CUSTNO, by listing every duplicate name.

Which two methods can be used to produce the required result?

Choose two
Explanation

A self join can compare two aliases of CUSTOMERS for equal CUSTNAME values while requiring different CUSTNO values, thereby identifying the same name stored under different primary keys. A subquery can likewise select names whose occurrence count exceeds one, or test for another row with the same name and a different key. Oracle defines a self join as a join of a table to itself and supports nested subqueries for multi-part retrieval conditions.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!