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

Connected

Exercise

NATURAL JOIN

Pissa, the ever-expanding pizza delivery enterprise, has a new challenge for you. They're interested in discovering which type of pizza generates the most revenue.

Here is the pizza schema for reference:

Schema Diagram

Identify the single top-selling pizza category using your knowledge of NATURAL JOIN.

Instructions

100 XP
  • Get the category from the appropriate table.
  • NATURAL JOIN the pizza_type table.
  • Group the records by category from the pt (pizza_type) table.
  • Order the details by total_revenue in descending order and limit to a single record, so that only the top revenue-generating pizza is returned.
Powered by Snowflake