image
SnowSQL CLI

Contents

Introduction
1
Course Intro
PREVIEW1m 46s
2
Snowflake Intro
PREVIEW8m 43s
Architecture
Snowflake
4
6
8
Security
9m 43s
9
Pricing
6m 39s
11
12
Snowpipe
4m 23s
Summary
13
Start course
Difficulty
Beginner
Duration
1h 33m
Students
702
Ratings
4.4/5
starstarstarstarstar-half
Description

Snowflake is an insanely cool next generation SaaS data warehousing solution that operates in the cloud!

Engineered from the ground up, Snowflake takes advantage of the elasticity that the cloud provides – and is truly revolutionary in every aspect.

Harnessing the power of the cloud, Snowflake has unique capabilities in the form of unlimited and instant scalability, making it perhaps the ultimate data warehouse solution. Cloud elasticity is very much at the heart of Snowflake – making its unique architecture and value proposition difficult to compete with in the market.

From an end user perspective, Snowflake is incredibly appealing. Building data warehouses and petabyte data scaled solutions without having to worry about on-prem compute and storage issues means your focus remains solely on the data itself and even more importantly, the analytics you derive from

In this course, you'll learn about the many distinguishing features that set Snowflake apart from its competitors.

For any feedback, queries, or suggestions relating to this course, please contact us at support@cloudacademy.com.

Learning Objectives

  • Learn about Snowflake and how it can provision cloud-hosted data warehouses
  • Learn how to administrate a Snowflake data warehouse
  • Learn how to scale Snowflake data warehouses instantly and on-demand
  • Learn how to use Snowflake to perform analytics on petabyte scale and beyond datasets

Intended Audience

  • Anyone interested in learning about Snowflake, and the benefits of using it to build a data warehouse in the cloud

Prerequisites

To get the most from this course, it would help to have a basic understanding of:

  • Basic Cloud and SaaS knowledge
  • Basic DBA knowledge
  • Basic SQL knowledge
Transcript

Welcome back. In this lesson, I'll provide an overview of the SnowSQL CLI. SnowSQL is a feature rich command line client that can be installed locally for the purpose of executing SQL queries directly from within your terminal. Sometimes it's just quicker to do it this way. Let's see how. SnowSQL is Snowflake's command line utility. This utility enables you to conveniently perform similar SQL activities that you would typically do within the web-based SQL worksheet.

As you can see in the screenshot, you can perform all of the typical  Snowflake DDL and DML commands, such as running SQL queries to report on and analyze data, creating new rules, granting permissions on objects, creating new databases, dropping existing objects etc. and much more. Although all of these activities can be performed within the web-based online Snowflake worksheet, it can still be more convenient sometimes to do this from within your terminal. Actually, when it comes to staging files hosted locally, SnowSQL is the tool to go for as it understands the put command and the equivalent action cannot be performed within the online worksheet.

SnowSQL, which is implemented in Python, is provided for all of the major operating systems, such as Linux, MacOS, and Microsoft Windows, and installing it is easy. Depending on the OS, there are different installation options, including both package installers and script-based installers. Install time is very quick, less than two minutes when accepting all of the defaults. Once installed, connecting and authenticating to your  Snowflake account is fairly straightforward. Simply open up your terminal and start the SnowSQL utility. The account and credentials can be supplied as parameters. SnowSQL documents each of the available command line options that can alter the way that it connects and authenticates. To consult these, use the --help parameter as shown here. This slide truncates the full set of available parameters, only showing those that are concerned with connecting and authenticating. There are several more parameters available, and it is recommended to the viewer to go and review the full set.

SnowSQL configuration defaults can be established and managed within the SnowSQL config file located within the current user's home directory. Within this file, you can set up and maintain defaults for connectivity and authentication. This file should be treated with care if you intend to use it to manage your Snowflake credentials. Now, a particular useful config option that I want to highlight since I find it more than useful when working within the SnowSQL CLI myself is the prompt format config option. Setting this will update the SnowSQL prompt to include the current users role, the current database and schema being acted on, and the virtual warehouse being used to execute the queries. All of this information is color coded and imprinted into the SnowSQL prompt as seen again in the next screenshot.

The information being visual makes it very clear to the end user the context in which they are operating within. Once you've connected and successfully authenticated against your own  Snowflake account, you can begin to author and execute Snowflake DDL and/or DML SQL statements. When doing so, the SnowSQL prompt will provide you with an intelligence autocompletion feature which can help you navigate the various objects within a particular database schema. For example, as seen here within the screenshot, the user is presented with a list of column names applicable to the flights table that they are intending to query.

 

About the Author
Students
133636
Labs
68
Courses
111
Learning Paths
190

Jeremy is a Content Lead Architect and DevOps SME here at Cloud Academy where he specializes in developing DevOps technical training documentation.

He has a strong background in software engineering, and has been coding with various languages, frameworks, and systems for the past 25+ years. In recent times, Jeremy has been focused on DevOps, Cloud (AWS, Azure, GCP), Security, Kubernetes, and Machine Learning.

Jeremy holds professional certifications for AWS, Azure, GCP, Terraform, Kubernetes (CKA, CKAD, CKS).