I'm new to SQL and am having trouble understanding why there's a FROM
keyword in a JOIN
statement if I use dot notation to select the tables.columns
that I want. Does it matter which table I choose out of the two? I didn't see any explanation for this in w3schools definition on which table is the FROM
table. In the example below, how do I know which table to choose for the FROM
? Since I essentially already selected which table.column
to select, can it be either?
For example:
SELECT Customers.CustomerName, Orders.OrderID
FROM Customers
INNER JOIN Orders
ON Customers.CustomerID=Orders.CustomerID
ORDER BY Customers.CustomerName;