1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Snowflake SQL

Connected

Exercise

Early filtering

Pissa has now asked for your expertise to optimize the performance of their database queries. They suspect that their existing queries are not efficient enough and take too long to run.

The goal is to retrieve the orders made after November 01, 2015, and only the pizzas in the 'Veggie' category.

Complete the given SQL query by implementing early filtering techniques.

Instructions

100 XP
  • Complete the filtered_orders CTE, filtering only to include orders made after 2015-11-01.
  • Complete the filtered_pizza_type CTE, filtering only to include pizzas in the 'Veggie' category.
  • Retrieve the records from the filtered_orders CTE.
  • Join the filtered_pizza_type CTE based on the pizza_type_id column using ON clause.
Powered by Snowflake