Which two statements are true regarding the USING clause in table joins?(Choose two.)
A.
It can be used to join a maximum of three tables.
B.
It can be used to restrict the number of columns used in a NATURAL join.
C.
It can be used to access data from tables through equijoins as well as nonequijoins.
D.
It can be used to join tables that have columns with the same name and compatible data types.
Explanation:
NATURAL JOIN operation
A NATURAL JOIN is a JOIN operation that creates an implicit join clause for you based on the common
columns in the two tables being joined. Common columns are columns that have the same name in both
tables.
If the SELECT statement in which the NATURAL JOIN operation appears has an asterisk (*) in the select list,
the asterisk will be expanded to the following list of columns (in this order):
All the common columns
Every column in the first (left) table that is not a common columnEvery column in the second (right) table that is not a common column
An asterisk qualified by a table name (for example, COUNTRIES.*) will be expanded to every column of that
table that is not a common column.
If a common column is referenced without being qualified by a table name, the column reference points to the
column in the first (left) table if the join is an INNER JOIN or a LEFT OUTER JOIN. If it is a RIGHT OUTER
JOIN, unqualified references to a common column point to the column in the second (right) table.
Syntax
TableExpression NATURAL [ { LEFT | RIGHT } [ OUTER ] | INNER ] JOIN { TableViewOrFunctionExpression |
( TableExpression ) }
Examples
If the tables COUNTRIES and CITIES have two common columns named COUNTRY and
COUNTRY_ISO_CODE, the following two SELECT statements are equivalent:
SELECT * FROM COUNTRIES NATURAL JOIN CITIES
SELECT * FROM COUNTRIES JOIN CITIES
USING (COUNTRY, COUNTRY_ISO_CODE)
The question is tricky.. You can not use NATURAL JOIN and USING.
true … had to look it up myself.
“natural join”, “using” and equi-join just being different names/forms of the same thing
How to create a join with the USING clause in Oracle?
Use the USING clause to specify the columns for the equijoin where several columns have the same names but not same data types.
Use the USING clause to match only one column when more than one column matches.
The NATURAL JOIN and USING clauses are mutually exclusive.
Syntax::
SELECT table1.column, table2.column
FROM table1
JOIN table2 USING (join_column1, join_column2…);
Explanation:
table1, table2 are the name of the tables participating in joining.
The natural join syntax contains the NATURAL keyword, the JOIN…USING syntax does not.
An error occurs if the NATURAL and USING keywords occur in the same join clause.
The JOIN…USING clause allows one or more equijoin columns to specify in brackets after the USING keyword.