SQL can be very simple
Consider the dataset on the right, and assume you’d like to see all cities in the top 23 that are in New York, California, Florida, and Texas. You have 2 options:
Option 1:
SELECT *
FROM database_table
WHERE ST = ‘NY‘ OR ST = ‘CA‘ OR ST = ‘FL‘ OR ST = ‘TX‘
Option 2:
SELECT *
FROM database_table
WHERE ST IN (‘NY‘, ‘CA‘, ‘FL‘, ‘TX‘)
Option 1 — This is the simple way of setting State equal to NY or CA etc as in the previous lessons
Option 2 — Use the IN keyword and the list of items you’d like to check a column for, basically checking to see if that specific column’s data (‘NY’) is in the ST column so you don’t have to re-type “ST = ‘‘“ each time, since if there’s a longer list it can be cumbersome.
Ultimately, both SQL statements will return the same data but the second option is easier to write.