Bocho Todorov
Bocho Todorov

Reputation: 429

What does dot mean in SQL query

In the w3school tutorial for the SQL "JOIN command", the given example is:

SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate
FROM Orders
INNER JOIN Customers
ON Orders.CustomerID=Customers.CustomerID;

My question is what does the dots mean in Orders.OrderID, Customers.CustomerName, Orders.OrderDate and so on?

Upvotes: 2

Views: 5209

Answers (3)

user3158958
user3158958

Reputation: 51

in this case: Orders.OrderID the OrderID is a column in Orders table. lets asume, that OrderID is a column in Customers table, you must define from which table you wish to get the OrderID column

Upvotes: 2

Shad
Shad

Reputation: 4464

In this particular example it separates table name with column name. It helps when two or more tables have columns with the same name.

Upvotes: 3

BanksySan
BanksySan

Reputation: 28500

In this case:

TableName.Column

You might also see aliases

e.g.

SELECT a.column1, b.column2
FROM Table1 AS a
JOIN Table2 AS b

Upvotes: 1

Related Questions