Prerequisites

This tutorial requires a database, table, and virtual warehouse to load and query data. Creating these Snowflake objects requires a Snowflake user with a role with the necessary access control permissions. In addition, SnowSQL is required to execute the SQL statements in the tutorial. Lastly, the tutorial requires CSV files containing sample data to load.

Note that you can complete the tutorial using an existing Snowflake warehouse, database and table, and your own local data files; however, for simplicity, we recommend using the Snowflake objects and set of data files we’ve provided.

In this Topic:

Required User and Permissions

To create the database, table, and virtual warehouse used in this tutorial, your Snowflake user must have a role that has been granted the necessary permissions to create these objects.

If you do not have a Snowflake user yet, or if your user does not have an appropriate role, please contact one of your account or security administrators (users with the ACCOUNTADMIN or SECURITYADMIN role).

SnowSQL Installation

To install SnowSQL, see Installing SnowSQL.

Configuring the Z Shell Alias (macOS Only)

If Z shell (also known as zsh) is your default terminal shell, set an alias to the SnowSQL executable so that you can run SnowSQL on the command line in Terminal. The SnowSQL installer installs the executable in /Applications/SnowSQL.app/Contents/MacOS/snowsql and appends this path to the PATH or alias entry in ~/.profile. Because zsh does not normally read this file, add an alias to this path in ~/.zshrc, which zsh does read.

To add an alias to the SnowSQL executable:

  1. Open (or create, if missing) the ~/.zshrc file.

  2. Add the following line:

    alias snowsql=/Applications/SnowSQL.app/Contents/MacOS/snowsql
    
  3. Save the file.

Sample Data Files for Loading

Download the set of sample data files. Right-click the name of the archive file, getting-started.zip, and save the link/file to your local file system.

You can unpack the sample files in any location; however, we recommend using the directories referenced in the tutorial examples:

Linux/macOS

/tmp

Windows

C:\temp

The sample files include dummy employee data in CSV format with five records each. The field delimiter is the comma (,) character.

Example record:

Althea,Featherstone,afeatherstona@sf_tuts.com,"8172 Browning Street, Apt B",Calatrava,7/12/2017

Note

  • There are no blank spaces before or after the commas separating the fields in each record. This is the default that Snowflake expects when loading CSV data.

  • Because the field delimiter is the comma character, any commas within a field string must be escaped, or the entire field must be enclosed in double quotes (" ").

Next: Step 1. Log into SnowSQL

Back to top