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
)