1Z0-061 · Question #113
See the Exhibits and examine the structures of PRODUCTS, SALES and CUSTOMERS table: You issue the following query: Which statement is true regarding the outcome of this query?
The correct answer is B. It produces an error because a column used in the NATURAL join cannot have a qualifier. Creating Joins with the USING Clause Natural joins use all columns with matching names and data types to join the tables. The USING clause can be used to specify only those columns that should be used for an equijoin. The Natural JOIN USING Clause The format of the syntax for…
Question
See the Exhibits and examine the structures of PRODUCTS, SALES and CUSTOMERS table:
You issue the following query:
Which statement is true regarding the outcome of this query?
Options
- AIt produces an error because the NATURAL join can be used only with two tables
- BIt produces an error because a column used in the NATURAL join cannot have a qualifier
- CIt produces an error because all columns used in the NATURAL join should have a qualifier
- DIt executes successfully
How the community answered
(69 responses)- A4% (3)
- B71% (49)
- C9% (6)
- D16% (11)
Explanation
Creating Joins with the USING Clause Natural joins use all columns with matching names and data types to join the tables. The USING clause can be used to specify only those columns that should be used for an equijoin. The Natural JOIN USING Clause The format of the syntax for the natural JOIN USING clause is as follows: SELECT table1.column, table2.column JOIN table2 USING (join_column1, join_column2...); While the pure natural join contains the NATURAL keyword in its syntax, the JOIN...USING syntax does not. An error is raised if the keywords NATURAL and USING occur in the same join clause. The JOIN...USING clause allows one or more equijoin columns to be explicitly specified in brackets after the USING keyword. This avoids the shortcomings associated with the pure natural join. Many situations demand that tables be joined only on certain columns, and this format caters to this requirement.
Topics
Community Discussion
No community discussion yet for this question.