595. Big Countries, 1757. Recyclable and Low Fat Products




595. Big Countries

리트코드


SELECT name, population, area
  FROM World
 WHERE area >= 3000000
    OR population >= 25000000


1757. Recyclable and Low Fat Products

리트코드


SELECT product_id
  FROM Products
 WHERE low_fats = 'Y'
   AND recyclable = 'Y'


584. Find Customer Referee

리트코드


SELECT name
  FROM Customer
 WHERE referee_id != 2
   OR referee_id IS NULL

!= 연산자로는 null은 해당이 안된다.

183. Customers Who Never Order

리트코드


   SELECT C.name AS 'Customers'
     FROM Customers C
LEFT JOIN Orders O
       ON C.id = O.customerId
    WHERE O.customerId IS NULL
   SELECT name AS 'Customers'
     FROM Customers
    WHERE id NOT IN (
                     SELECT customerId
                       FROM Orders
                    )