Snowpro Associate Platform · Free Practice Question Easy
Question 10
myvar in a SQL cell within a Snowflake Notebook? -
A
'myvar'
- B {{myvar}}
Reveal correct answer
Correct answer: B
Explanation
✅ {{myvar}}
Explanation:
In Snowflake Notebooks, you can reference Python variables inside SQL cells using Jinja-style syntax, which means wrapping the variable name in double curly braces: {{myvar}}. This allows dynamic substitution of Python values directly into SQL queries, enabling flexible and interactive workflows across cell types.
❌ Why the other options are incorrect?
'myvar' → Incorrect, as this is not valid syntax and would likely result in a SQL parsing error.
$myvar → Incorrect, because Snowflake Notebooks do not use shell-style variable substitution.
myvar → Incorrect, since referencing the variable without curly braces won’t trigger substitution—it will be interpreted as a literal column or identifier.
For more, check out Snowflake’s guide to referencing variables in Notebooks.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
