Activity 2: Learn the WHERE Command
Task 2: Travel to the Planet of Fun!
You need to program your rocket ship GPS to go to the Planet of Fun by rearranging the code blocks. To find the coordinates,
the Galactic Federation has given you the next SQL command:
What the command does:
WHERE command allows you to only show data that you want.
SELECT * FROMdatabase block that we learned from the previous activity allows us to choose a database to look through.
WHEREcommand allows us to narrow down what data is displayed depending on the condition (the green blocks in the image below). A condition is a requirement you are looking for. Conditions do not have to follow the example above, but the most common use of conditions are looking for rows that contain specific information.
The name of the column we wish to look for information in.
The equal sign means that we want to find information that matches what we have on the right-hand side of the equal sign.
When we are looking for specific words or text, we must surround the text with single quote marks. SQL uses single quote marks to indicate that we are looking for a word in the database.
You can replace ‘text’ with any word you are looking for in the database.
Semicolons act as the end of a SQL command, like a period at the end of a sentence.