Jump to content

Question related to the "dot"usage in SQL


GerardoH95

Recommended Posts

Im currently following the SQL tutorial on w3schools and i got stuck in the Alias section about the usage of the "dot" in a query, after looking it on google i found that its something like a parent-child relation so that the DBMS know where to fetch the values from.

However i feel that this example in the tutorial is too verbose:

SELECT Orders.OrderID, Orders.OrderDate, Customers.CustomerName
FROM Customers, Orders
WHERE Customers.CustomerName="Around the Horn" AND Customers.CustomerID=Orders.CustomerID;

 

And can be easily translated to this other one

SELECT OrderID, OrderDate, CustomerName
FROM Customers, Orders
WHERE CustomerName="Around the Horn" AND Customers.CustomerID=Orders.CustomerID;

 

it retrieves the same data in the practice tool, so i want to know if im doing a good practice by removing this redundancy or not.

here is the link to the topic im talking about:  https://www.w3schools.com/sql/sql_alias.asp

 

Link to comment
Share on other sites

I believe it's been deliberately verbose to illustrate it. You won't find this level of explicit alias usage elsewhere in other tutorials.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...