Essential Question: How can I use the logic gates AND, OR, or NOT?
Mastery Objectives:
SWBAT create a query using the logic gate AND in SQL.
SWBAT create a query using the logic gate OR in SQL.
SWBAT create a query using the logic gate NOT in SQL.
Directions: Create the following queries and take a screenshot of your results, describe what is happening, and put them into google docs and submit them to google classroom. https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_where_and
Resources:Â
https://www.youtube.com/watch?v=wr7Qwp0cBzI - Why you need to know SQL if you want a job in Data Science
https://www.youtube.com/watch?v=PXLVLS1vJHY - Is Data Science Really a Rising Career?
https://logic.ly/demo/ - logic gate simulator
SELECT * FROM Customers WHERE Country='Germany' AND City='Berlin';
SELECT * FROM Customers WHERE City='Berlin' OR City='London';
SELECT * FROM Customers WHERE Country='Germany' OR Country='Spain';
SELECT * FROM Customers WHERE NOT Country='Germany';
SELECT * FROM Customers WHERE Country='Germany' AND (City='Berlin' OR City='Stuttgart');
SELECT * FROM Customers WHERE NOT Country='Germany' AND NOT Country='USA';
Create your own: Select all records where the City column has the value 'Berlin' and the PostalCode column has the value 12209.
Create your own: All records where the country is USA or Venezuela but not where the city is Walla Walla
Create your own: All records where the country is in Europe but the city is not London