Sitemap
Snowflake Builders Blog: Data Engineers, App Developers, AI/ML, & Data Science

Best practices, tips & tricks from Snowflake experts and community

Follow publication

Snowflake Copilot - Leveraging for Account Admin Dashboard Queries

--

Snowflake Copilot is an LLM-powered assistant to generate and refine SQL with natural language within Snowflake and enable data analysis from start to finish.

To start, Copilot can be used in number of ways as it -
~ Answer questions about how your data is structured.
~ Guides you in exploring new datasets.
~ Generate and refine SQL queries to extract useful information from your data.
~ Improve SQL queries by recommending optimizations or suggesting fixes for possible issues.
~ Helps with understanding of Snowflake features referencing Snowflake documentation.

To demonstrate it’s capability let us see how easily one can generate sql queries in Snowflake to build admin dashboard that we have done here — https://snowflakewiki.medium.com/building-dashboard-for-snowflake-account-monitoring-349b93c7ea39

1. Snowflake Copilot is ready to use with no additional setup. In a new worksheet or existing worksheet, select Ask Copilot in the lower-right corner of the worksheet.

2. The Snowflake Copilot panel opens on the right side of the worksheet.

3. select database and a schema by using either the selector on the top of the worksheet or the selector below the Snowflake Copilot message box.

Select SNOWFLAKE database and ACCOUNT_USAGE schema. Note user need to have access privileges on that object, as Snowflake Copilot fully respects RBAC.

4. In the message box, type in your question and then select the send icon or press Enter to submit it.

Let us enter — “Can you help me with the query to find the credits used by different warehouses?

5. Snowflake Copilot provides a response in the panel with information and SQL statement.

  • Select Run to run the query. This adds the query to your worksheet and runs it.
  • Select Add to edit the query before running it. This adds the query to your worksheet.

6. The query is added to the worksheet with the comments of the prompt and returns the results. Further use the chart option and move it to existing Dashboard.

7. Further type in another question, to observe how Copilot behaves.

Let us enter — “Can you help with the date wise credits used for each warehouse?

8. Snowflake Copilot provides a response in the same panel with information and SQL statement.

9. Select Run for the query to get appended to the same worksheet with comments and retuning the new SQL results.

If you want to add the new query into dashboard, need to do it in new worksheet and move it to existing dashboard.

Similarly we can try other requirement questions and leverage Snowflake Copilot to build an entire Admin Dashboard. Even complex queries can be build through a conversation with Snowflake Copilot by asking follow-up questions, to refine the suggested SQL query and dig deeper into the analysis.

Do keep in mind the limitations and provide feedback (thumbs up or thumbs down) on each response from Snowflake Copilot, which will be used to improve the product.

References: https://docs.snowflake.com/en/user-guide/snowflake-copilot

Follow and Clap if you like the content and feel free to ask if you have any questions in the comments. I will be more than happy to assist and guide you.

--

--

Snowflake Wiki
Snowflake Wiki

Written by Snowflake Wiki

Snowflake Basics | Features | New releases | Tricks & Tips | SnowPro Certifications | Solutions | Knowledge Sharing | ~~~ By satitiru (Snowflake DataSuperHero)

No responses yet