Skip to main content

Database, table, and virtual warehouse are basic Snowflake objects required for most Snowflake activities. Setting them will be the first step in all our exercises! Let’s see how to do that!

Create a Snowflake account

Click here to create your new Snowflake account. It should be configured to use Amazon Web Services (AWS) and your user has the ACCOUNTADMIN role. In this way, you can create a database, tables, and virtual warehouse objects. You can use the 30-day free trial! But remember that everything will expire! So, please, save all! The exceeding £400 in credits can be another reason to lose everything before 30 days. Again, be careful! Working with a X-small warehouse is sufficient for our exercises.

Create your database and warehouse

By means of the CREATE (OR REPLACE) DATABASE stament we create our database. It includes automatically a SCHEMA, i.e. the PUBLIC one. If you want another one, you can CREATE (OR REPLACE) SCHEMA ‘myschema’ and your tables and views will be there!

--Create your database
CREATE OR REPLACE DATABASE mydatabase;

--Create your warehouse
CREATE OR REPLACE WAREHOUSE mywarehouse WITH
     WAREHOUSE_SIZE='X-SMALL
     SCALING_POLICY = STANDARD
     AUTO_SUSPEND = 120
     AUTO_RESUME = TRUE;

In the CREATE (OR REPLACE) WAREHOUSE statement we can add some object properties. By default we have a standard type warehouse. We can set the size of our warehouse. The bigger is the size, the bigger is the amount of compute resources in each cluster.. actually the bigger is the amount of money you “spend”! By deafult, the size of warehouse is XSMALL!

You can set the policy for the starting and shutting down cluster in a multi-cluster warehouse, especially when it is set in Auto-scale mode. There are two values: standard and economy. By default the valid value set is STANDARD. This just minimizes queuing by starting clusters.

As for the AUTO_SUSPEND property it declares the amount of seconds of inactivity before that the warehouse automatically suspends. By default the warehouse suspends after 10 minutes. If you set NULL, the warehouse never suspends.

If you want that your warehouse resumes automatically when a new query is submitted, you can set TRUE value to the AUTO_RESUME property. Generally, this statement is set to TRUE. You can add as many properties as you like, but read through the documentation about warehouses.

Create a table or a view

You can create a new TABLE into your schema or you can replace an existing one. Remember that there are several commands which are linked to CREATE TABLE. Be sure to select the one best suited for your needs. But keep things easy here:

Auteur

  • Sofia Pierini

    She is a critical thinker who draws inspiration from the intersection of logic, coding and philosophy. She is both strong-willed and multifaceted, and have a track record that demonstrates her competence in interdisciplinary fields. She has a Master Degree in Philosophy and her interest lies in the application of these fields to decision making, especially related to artificial and business intelligence but also to machine learning. As vice president, she organizes IUBEL, a festival dedicated to Jacopone da Todi’s masterpieces and the city of Todi. She is passionate about hardcore punk music but she never turns down an invitation to go see the opera! Analytics Engineers are cloud-based data specialists, new members in data team, whilst philosophers often have their head in clouds. How a philosopher may become an Analytics Engineers? She wrote a blog about it https://nimbusintelligence.com/2023/03/can-a-philosopher-become-a-analytics-engineer/. The Nimbus academy empowers its students with a modern, cutting-edge education, as well as the soft-skills and formation necessary to succeed as consultants and data professionals. Therefore, in this scenario, it seems possible that a philosopher could belong to the next generation of Analytics Engineering. However, she is ready to face many challenges.

Sofia Pierini

She is a critical thinker who draws inspiration from the intersection of logic, coding and philosophy. She is both strong-willed and multifaceted, and have a track record that demonstrates her competence in interdisciplinary fields. She has a Master Degree in Philosophy and her interest lies in the application of these fields to decision making, especially related to artificial and business intelligence but also to machine learning. As vice president, she organizes IUBEL, a festival dedicated to Jacopone da Todi’s masterpieces and the city of Todi. She is passionate about hardcore punk music but she never turns down an invitation to go see the opera! Analytics Engineers are cloud-based data specialists, new members in data team, whilst philosophers often have their head in clouds. How a philosopher may become an Analytics Engineers? She wrote a blog about it https://nimbusintelligence.com/2023/03/can-a-philosopher-become-a-analytics-engineer/. The Nimbus academy empowers its students with a modern, cutting-edge education, as well as the soft-skills and formation necessary to succeed as consultants and data professionals. Therefore, in this scenario, it seems possible that a philosopher could belong to the next generation of Analytics Engineering. However, she is ready to face many challenges.