QuestionQ115

VerifiedDisplaying Data from Multiple Tables

Review the exhibits and examine the structures of the products, sales, and customers tables.

Question Image

Question Image

Question Image

You need to produce a report showing the customer's last name, the product name, and the quantity sold for customers in 'Tokyo'.

Which two queries return the required result?

Question Image

Choose two
Explanation

SALES.PROD_ID joins to PRODUCTS.PROD_ID, and SALES.CUST_ID joins to CUSTOMERS.CUST_ID; filtering CUST_CITY to 'Tokyo' returns the requested customers' sales. Both the USING joins in A and the ON joins in C correctly establish those relationships. In Oracle, an ON clause must follow a join, so B does not introduce CUSTOMERS before its second ON clause. Oracle also prohibits qualifying a column that is named in a USING clause, which makes D invalid because it selects C.CUST_ID and P.PROD_ID.

Learn more

Community Discussion

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