Session Ready
Exercise

Querying the snowflake schema

Imagine that you didn't have the data warehouse set up. Instead, you'll have to run this query on the company's operational database, which means you'll have to rewrite the previous query with the following snowflake schema:

The tables in this schema have been loaded. Remember, our goal is to find the amount of money made from the novel genre in each state.

Instructions
100 XP
  • Select state from the appropriate table and the total sales_amount.
  • Complete the two JOINS to get the genre_id's.
  • Complete the three JOINS to get the state_id's.
  • Conditionally select for books with the genre novel.
  • Group the results by state.