113k views
0 votes
When two tables that share more than one common column are being joined, the JOIN...____________________ keywords are normally used in the FROM clause to join the tables.

a) AND
b) OR
c) NOT
d) USING

1 Answer

1 vote

Final answer:

The correct keyword to use when joining two tables with more than one common column in the FROM clause is JOIN...USING.

Step-by-step explanation:

When two tables that share more than one common column are being joined, the JOIN...USING keywords are normally used in the FROM clause to join the tables. the USING clause allows you to specify the columns that should be compared for equality in both tables. if there's more than one common column, you can list them all in parentheses, separated by commas, after the USING keyword.

For example if you have two tables, customers and orders, with customer_id and country columns being common to both, you would write the join as:

SELECT * FROM customers JOIN orders USING (customer_id, country);

This statement would combine rows from both tables where the customer_id and country columns are equal. using the USING clause simplifies the syntax and avoids the need to qualify the column names with table names or aliases when the columns have identical names in both tables.

User Yuyichao
by
7.8k points