Jump to content

Patty_Tu

Members
  • Posts

    5
  • Joined

  • Last visited

Patty_Tu's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. But what if there are lots of columns in that table? I just think it's inefficient to mention every column under WHERE syntax lol... Isn't there any other way to test if any row has NULL value?
  2. I'm working on this session, and it shows if I'd like to test NULL value, I'll need to use below syntax: However, I'd like to know what if I have no idea which column(s) has(have) NULL value? How should I make a query to look for ANY record that includes NULL value without writing specific column_name?
  3. Got it! Thank you so much for your response! It's really helpful to me!!
  4. 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?
×
×
  • Create New...