An Introduction of Snowflake Semantics

by Zachary Ryan

During your time at the Data School, you'll get familiar with a service known as Snowflake. What's different about Snowflake as a service is that the semantics used differs from the likes of Tableau calculated fields and Alteryx as well, due to the fact that it is, a different type of service entirely. It acts as a cloud-based storage service of data, where you can extract that data and then bring it into new tables, or join them together. As a result of this being a more introductory blog, this will look at some of the more basic commands you'll use in your first couple lessons on Snowflake.

  • SELECT - this is your bread and butter when it comes to Snowflake. You'll be using this to retrieve records from data sources and can specify what columns you'd like from those data sources. For example, using 'SELECT *' will give you every single record from the table that you're taking data from. You can also specify certain columns through making your command prompt something like this - 'SELECT "Ship Date". This would retrieve only the 'Ship Date' column from the Superstore table on Snowflake.
  • You can also use prompts like SELECT DISTINCT - which as you can guess, gives you only the distinct values - you would use this for the likes of ORDER ID - getting the unique orders made by customers
This table shows the results of a SELECT * command
  • From here, you can start to incorporate commands like 'FROM' and 'WHERE', as well as 'ORDER BY'
  • FROM - specifies which table you want to get your data from
  • WHERE - specifies certain parameters that you want the fields to follow - Think of this like a filter tool in Alteryx - refining what you want before then getting those fields that fit that criteria. You can chain this with an 'AND' command and do things like the picture below
  • ORDER BY - think of this as the sort in Alteryx - you can specify if you want it in ascending order (ASC) or descending (DESC) - with descending order, if you don't specify what order you want your data to be sorted in, you will naturally get it in a descending fashion
Example of a more complex Snowflake request - looking at the top 20 customers in terms of profit and sales, where the profit is higher than 50 and sales is less than 500, all while being ordered by profit in a descending order

Here's some of the basic prompts you'll learn in your first couple Snowflake sessions and hopefully this blog acts as a refresher, or a way to get ahead of the rest of the class!

Wed 26 Oct 2022

Tue 25 Oct 2022

Tue 25 Oct 2022