ComeçarComece de graça

Determining buyer intent

You've determined that a few things go into a customer buying a song. These include things like the genre and length of a song, as well as its price. Now, you're going to translate these into actionable data by writing a query to measure buyer intent.

Este exercício faz parte do curso

Data Manipulation in Snowflake

Ver curso

Instruções do exercício

  • Create a CASE statement; if songs have a unit_price of 0.99 and are either Rock and Roll or Pop (genre 5 and 9), classify as 'High' buyer intent.
  • If a song is shorter than 5 minutes (300000 milliseconds) and isn't Electronic Dance Music (genre 15), it should have 'Neutral' buyer intent.
  • All other songs should have 'Low' buyer intent.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

SELECT
    name,
    unit_price,
    CASE
        -- Inexpensive Rock and Pop songs are always high-intent
        WHEN ___ = ___ AND genre_id IN (___, ___) THEN '___'
        -- Shorter, non-EDM tracks have neutral buyer intent
        ___ milliseconds < ___ ___ ___ != ___ ___ '___'
		-- Everything else is low
        ___ '___'
    END AS buyer_intent
FROM store.track;
Editar e executar o código