1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Data Modeling in Snowflake

Connected

Exercise

Subquery mastery

You are the data modeler of a business that manages hotel chain data. The business team has the task of examining customer data to inform retention strategies. The marketing department needs insights into high-income customers' activity status and engagement with the hotel's services. Your goal is to use the existing customer data to identify active and churned customers with a high estimated salary and to analyze their average age and tenure. To achieve this goal, you can use this pre-built common table expression CustomerStatus.

Instructions 1/3

undefined XP
    1
    2
    3
  • Extract the customer status from customer_status CTE.
  • Filter the results of the query to have only customerids that have the attribute estimatedsalary greater than 175000, which resides in the customers entity.