# Using the History Page to Learn Queries  - Snowflake

> 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:** 2022-08-09
- **Format:** Video · 7 min watch · transcript available
- **Topics:** Data engineering, Analytics
- **Tools:** Snowflake (databases, query history); SQL (select)
- **Canonical:** https://just-tim.com/posts/using-the-history-page-to-learn-queries-snowflake
- **Watch:** https://www.youtube.com/watch?v=yW77YlDfwms

I show how to learn Snowflake SQL by performing actions in the Snowflake interface and then inspecting the query that Snowflake generated behind the scenes. Using the query history page, I demonstrate this by previewing data and creating and dropping a database, then reusing that generated SQL in a worksheet.

## Key takeaways

- Everything you do in the Snowflake interface generates an underlying SQL statement you can inspect and reuse
- The Activity > Query History page shows the exact SQL Snowflake ran, including row limits like LIMIT 100
- You can copy generated SQL into a worksheet to learn and re-run it, building up reusable scripts
- Always highlight the specific line before hitting run to avoid executing your entire worksheet
- You can switch between the modern Snowsight interface and the classic console, and save generated SQL to GitHub for reuse

## Chapters

- 0:00 Why learn from generated queries
- 0:33 Switching between Snowsight and classic
- 1:27 Previewing data and viewing its query
- 2:49 Reusing the SQL in a worksheet
- 3:30 Creating and dropping a database via SQL
- 5:54 Building reusable scripts to learn

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/using-the-history-page-to-learn-queries-snowflake

---
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
