Activity 6: Use Comparators

Workshop Resources

Task 6: Find the Legendary Totem of Fun: Confetti Cannon

You need to explore the planet and find the first Legendary Totem of Fun - The Confetti Cannon of Fun. Legends say that this cannon will never stop shooting confetti and it is a symbol of never-ending peace and entertainment.

Your only hint is that the artifact is created on 1738-09-12.

To help you out, the Galactic Federation has sent you a brief tutorial on how to compare numbers in the database.

Explain Example

  • In example 2, the != symbols could be used instead of <> to give the same output.

  • Notice the value in [value to compare] in SELECT * FROM [database] WHERE [column_name] [Comparator] [value to compare]; Note that numbers do not need single quotation marks around them but date/words need to be inside single quotation marks! If Transportation had 2 more columns called “Name” that stored name of the vehicle and “Date” that stored the date of manufacture of the vehicle, we would query them like this:

    SELECT * FROM Transportation WHERE Fuel > 20;

    SELECT * FROM Transportation WHERE Name = 'myrocket';

    SELECT * FROM Transportation WHERE Date > '2021-01-01';

Using the database called ‘items’ with the column labeled ‘date_created’, find out which artifact is the Legendary Totem of Fun: Confetti Cannon

You can display the database using the command from activity 1.

  • Hint 1: The artifact is created on ‘1738-09-12’ (Use single quotation marks around the date).

  • Hint 2: What comparator do you need to use to find an exact match?

  • Hint 3: The correct command follows closely to the example above.

  • Hint 4: You do not need single quotation marks around the column or database names in this command.

  • Hint 5: What symbol do you need at the end of a SQL command?

  • BONUS: Display all items created on and after ‘1738-09-12’ as well!

Type command here!

ERROR INVALID INPUT>