Microsoft Azure Data Fundamentals — Question 199
You have the following T-SQL statement.
SELECT o.OrderNo, o.OrderDate, c.Address, c.City
FROM Order AS o -
JOIN Customer AS c -
ON o.Customer = c.ID;
What is the function of the ON clause?
Answer options
- A. to update data in the Customer table
- B. to match data in the Customer table to data in the Order table
- C. to define an alias for the Customer table
- D. to update data in the Order table
Correct answer: B
Explanation
The ON clause is used to establish the relationship between the two tables by specifying how the records in the Customer table correspond to those in the Order table. Option A and D are incorrect because the ON clause does not modify any data. Option C is also wrong as it does not define an alias; the alias is defined in the FROM clause.