BaşlayınÜcretsiz Başlayın

Working out in the big city

Being one of the most popular data types in Snowflake, text data is often used within a query itself for things like CASE statements, WHERE clauses, and more!

You'll supplement a query that retrieves information about premium gym locations and classifies them as located in a major or non-major city. Keep a close eye on those text values!

Bu egzersiz

Data Types and Functions in Snowflake

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • In the CASE statement, update the first value in parentheses to be New York.
  • After the else keyword, add the string Non-Major City; this is the value that will be returned if the condition above does not match.
  • Update the WHERE clause to only return records with a gym_type of 'Premium'.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

SELECT
    gym_id,
    CASE
        -- Update the locations classified as a Major City
        WHEN location IN ('___', 'Los Angeles', 'Dallas') 
        THEN 'Major City'
        
        -- Otherwise, it's a Non-Major City
        ELSE '___'
    END AS gym_city
FROM CORE_GYM.gyms

-- Complete the WHERE clause to only return Premium gym types
WHERE gym_type = '___';
Kodu Düzenle ve Çalıştır