Description:
The SELECT statement is the one you will run more times than every other statement put
together. So in this first episode of the Snowflake SQL: Zero to Hero series we take it
slowly — and by the end you will know six different ways to use it.
We start where everyone starts, naming the columns you want. Then we get to the part that
is distinctly Snowflake: the four modifiers you can attach to SELECT * to take back
control of it — EXCLUDE, RENAME, REPLACE and ILIKE. Most SQL developers have never seen
these, and EXCLUDE in particular is the one people fall in love with.
Everything is demonstrated in a worksheet with the results pane on screen, so you can see
exactly what changes when the query changes.
WHAT'S COVERED
• The simplest SELECT — name three columns, get three columns back
• Why column order in your SELECT is your choice, not the table's
• SELECT calculates, it does not only fetch — expressions and AS
• SELECT * — and what you are actually asking for
• EXCLUDE — take everything, drop what you don't want
• RENAME — change the label
• REPLACE — change the values (and why it is NOT rename)
• ILIKE on * — pick columns by NAME pattern, not by value
• The fixed ordering when you combine them
CHAPTERS
0:00 Intro
0:28 Name the columns you want
1:25 It does not only fetch
2:09 Give me everything
3:00 Everything except these
3:38 RENAME and REPLACE
4:29 Pick columns by name pattern
5:07 The order is not yours to choose
5:49 Recap & wrap-up
THE SCRIPT
Every query in this video is in a script that creates its own EMPLOYEES table, so you can
paste it into any Snowflake worksheet and follow along. The same table is used by every
episode in this series, so you only ever set it up once.
REFERENCE
Snowflake SELECT documentation:
https://docs.snowflake.com/en/sql-reference/sql/select
Every clause description in this video is quoted directly from that page.
A NOTE ON THE DATA
The EMPLOYEES table is invented demo data, created by the script itself. No performance
claims are made anywhere in this series.
NEXT EPISODE
The FROM clause — table names, aliases, fully-qualified DATABASE.SCHEMA.TABLE names, and
a SELECT statement with no table at all.
#Snowflake #SnowflakeSQL #SQL #DataEngineering #SQLTutorial #TechBrothersIT #SnowflakeTutorial
Share this link via
Or copy link

























