1. Learn
  2. /
  3. Courses
  4. /
  5. Data Types and Functions in Snowflake

Connected

Exercise

Working with personal info

A new table was added to your data warehouse, which includes user-specific information. However, this data in the personal_info column of the members table is in VARIANT format, and takes the form below. Your job is to filter and parse this data into a result set that is usable for planning special offers for each member.

{
      "age": "56",
      "gender": "Female",
      "name": {
        "first": "Chris",
        "last": "Wilson"
      }
}

Instructions

100 XP
  • Use dot-notation to retrieve a member's age from the personal_info column, and pass the value to the TO_NUMBER function.
  • Use bracket-notation to retrieve a member's gender from personal_info.
  • Filter the result set to only include records for members at least 25 years old.
Powered by Snowflake