nerdexam
Oracle

1Z0-061 · Question #137

Which two statements are true regarding the USING and ON clauses in table joins? (Choose two.)

The correct answer is A. The ON clause can be used to join tables on columns that have different names but compatible D. The WHERE clause can be used to apply additional conditions in SELECT statement containing. Creating Joins with the USING Clause If several columns have the same names but the data types do not match, use the USING clause to specify the columns for the equijoin. Use the USING clause to match only one column when more than one column matches. The NATURAL JOIN and USING…

Displaying Data from Multiple Tables using Joins

Question

Which two statements are true regarding the USING and ON clauses in table joins? (Choose two.)

Options

  • AThe ON clause can be used to join tables on columns that have different names but compatible
  • BA maximum of one pair of columns can be joined between two tables using the ON clause
  • CBoth USING and ON clause can be used for equijoins and nonequijoins
  • DThe WHERE clause can be used to apply additional conditions in SELECT statement containing

How the community answered

(48 responses)
  • A
    73% (35)
  • B
    10% (5)
  • C
    17% (8)

Explanation

Creating Joins with the USING Clause If several columns have the same names but the data types do not match, use the USING clause to specify the columns for the equijoin. Use the USING clause to match only one column when more than one column matches. The NATURAL JOIN and USING clauses are mutually exclusive Using Table Aliases with the USING clause When joining with the USING clause, you cannot qualify a column that is used in the USING Furthermore, if that column is used anywhere in the SQL statement, you cannot alias it. For example, in the query mentioned in the slide, you should not alias the location_id column in the WHERE clause because the column is used in the USING clause. The columns that are referenced in the USING clause should not have a qualifier (table name oralias) anywhere in the SQL statement. Creating Joins with the ON Clause The join condition for the natural join is basically an equijoin of all columns with the same name. Use the ON clause to specify arbitrary conditions or specify columns to join. ?ANSWER C The join condition is separated from other search conditions. ANSWER D The ON clause makes code easy to understand.

Topics

#USING clause#ON clause#equijoin#table joins

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice