# Getting started with Snowflake PT-3: Running queries and using JSON

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-05-16
- **Format:** Video · 45 min watch · transcript available
- **Topics:** Data engineering, Analytics
- **Tools:** Snowflake (cloning, result cache, stages, variant, views, warehouses); SQL (aggregations, date functions, joins)
- **Canonical:** https://just-tim.com/posts/getting-started-with-snowflake-pt-3-running-queries-and-using-json
- **Watch:** https://www.youtube.com/watch?v=04X0TrFPdhU

This is the third video in my series working through Snowflake's Getting Started guide. I run analytical queries against the loaded CityBike data, explore the result cache and zero-copy cloning, then load JSON weather data using the variant type, create a view, and join semi-structured data to the trips table.

## Key takeaways

- Snowflake's result cache holds query results for 24 hours across all warehouses, so re-running an identical query returns in milliseconds and uses no compute credit
- Zero-copy cloning takes a snapshot via metadata and pointers rather than copying data, letting you spin up an independent, writable dev environment without doubling storage
- The variant column type lets Snowflake ingest semi-structured data like JSON, Parquet or Avro without predefining a schema
- You can query nested JSON fields directly using SQL dot notation (e.g. v:city.coord.lat) as if each field were a relational column
- The query profile view breaks down where time and cost were spent, such as a table scan consuming most of the work

## Chapters

- 0:39 Recap of loading data
- 1:36 Using Snowflake as a database
- 5:43 Running hourly statistics query
- 9:39 Profiling a query
- 11:24 The result cache in action
- 15:18 Busiest months query
- 16:35 Zero-copy cloning a table
- 21:54 Working with semi-structured JSON
- 24:41 Creating the variant table and stage
- 30:49 Loading and previewing JSON
- 34:34 Creating views and dot notation
- 40:56 Joining weather to trips data

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/getting-started-with-snowflake-pt-3-running-queries-and-using-json

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
