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.
Cet exercice fait partie du cours
Data Manipulation in Snowflake
Instructions
- Create a
CASEstatement; if songs have aunit_priceof0.99and are either Rock and Roll or Pop (genre5and9), classify as'High'buyer intent. - If a song is shorter than 5 minutes (
300000milliseconds) and isn't Electronic Dance Music (genre15), it should have'Neutral'buyer intent. - All other songs should have
'Low'buyer intent.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
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;