Hi There,
I have two questions about SQL syntax, the first one is about "SELECT DISTINCT" and the other is "NOT".
Question 1:
For example, "Customers" table has fields including CustomerID, CustomerName, ContactName, Address, City, PostalCode, Country. From my understanding, if my SQL statement is SELECT DISTINCT Country FROM Customers; then it will show the list of unique countries. However, I'd like to know what does it mean if my SQL statement is SELECT DISTINCT Country, City, CustomerName FROM Customers; ? Why I don't have to write SELECT DISTINCT Country, DISTINCT City, DISTINCT CustomerName?
You may refer to this session: https://www.w3schools.com/sql/sql_distinct.asp
Question 2:
I'm working on the session, and there's an example as below:
I understand that this example would like to exclude BOTH Country = "Germany" and Country = "USA", but I don't understand why using the operator [AND] instead of [OR]? Doesn't [AND] represent the intersection while [OR] mean union? So, if I want to exclude BOTH "Germany" and "USA", why I can't use [OR] as the operator in this example?