Why SQL and Mini Snowflake Intro



You recently learned how to drive and all of your cars have had automatic transmission.  You land a driving job and one day management tells you sometimes you will have to drive manual transmission vehicles, depending on the client.

Less than two months away from placement I found myself learning a new language.  A data query language to be exact.  I spent the past two and a half months becoming more proficient and fluent in data preparation, transformation, and visualized data analysis. My Data School placement fantasies are me impressing companies with Alteryx and Tableau.  

The reality is that powerful data analytic and preparation tools require significant financial investments. Some companies don’t use the same programs or limit access to the more expensive programs.  Data warehousing is commonplace since data is often fragmented and obtained from various sources.

Snowflake is an online data lake and warehouse. Precise queries and extraction become vital since cost is based on volume and data sizes can be quite voluminous. I will expand when I discuss SQL.

Image from: https://www.2ndwatch.com/blog/what-is-snowflake/

Snowflake plays well with others.





Easy web access


Sample Warehouse




Database and schema



Snowflake SQL canvas



SQL or Structured Query Language allows for the accessing of databases using simple syntax. As I mentioned earlier, precision is important when there is a charge for each query and the amount of data in each query.  Businesses are usually interested in reducing costs and optimizing efficiency. So SQL queries will need to be thoughtful and exact. Snowflake SQL uses the traditional SQL syntax and order of operations with slight variations.

SQL Order of Operations

SELECT   columns

FROM table

WHERE condition

GROUP BY Columns to aggregate

HAVING condition (Post agg)

ORDER BY Sort

Scalar Functions

Upper ()

Lower

Substring  - extract

Replace

Len - change a string or value

Round

Getdate




Simple query and return

SELECT *

FROM "Superstore_Orders"

LIMIT 100




SELECT ROUND(SUM("Sales")) AS "Total Sales","Person"

FROM "Superstore_Orders"

INNER JOIN "Superstore_People"

ON "Superstore_Orders". "Customer Name" = "Superstore_People". "Person"

GROUP BY "Person"

ORDER BY "Total Sales" DESC





Learning SQL reinforces understanding of tools and functions in Tableau Prep and Alteryx and instills thoughtfulness and specificity.

How do I learn SQL you ask?  Good question.  I was fortunate to receive instruction from 2022 VIz Champion, WIll Sutton.  If you have the will but don't have a Will, take advantage of the below resources. Like  any language you have to practice and keep using so you can save clients time and money., while answering important business questions.

SQL Resources

Codewars  https://www.codewars.com/kata/58112f8004adbbdb500004fe/train/sql

Hacker rank  https://www.hackerrank.com/

Codeacademy  https://www.codecademy.com/

LeetCode https://leetcode.com/

SQL Murder Mystery  https://mystery.knightlab.com/

Author:
Karen D. Hamilton
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab