You are here:

10 Practical Ways Data Teams Can Use Snowflake Cortex Code Instead of the Traditional Approach

Ever since Cortex Code was released, there have been plenty of lofty claims online about how it has transformed people’s businesses.

  • “We’ve completely transformed projects to fixed bid pricing”
  • “We’ve fixed all of our code issues in an afternoon”
  • “I’ve eliminated all my data engineering staff and now have 2,000 agents running my business while I sit on a beach all day”

And while some of these may be true (not the last one), what we’ve heard talking to data engineers at Snowflake’s Data for Breakfast conferences all around the country is that less than half of data professionals working on Snowflake have started using it on a daily basis.

Not because they don’t see the long-term value.

They simply already have a way that works, are busy, and don’t know where to start.

For those who do invest the time, they’re finding that Cortex Code introduces a different way of working. Instead of forcing data professionals to start every task from scratch, it gives you a way to move from intent to execution much faster inside the Snowflake environment. Whether the goal is exploring unfamiliar data, generating SQL, or even scaffolding apps and agents, Cortex Code can help reduce the manual effort required to get started and make progress.

My goal with this article is to help identify some of the best areas to start with Cortex Code and start integrating it into your workflow. I also want this to be actionable, so you have the exact instructions for where to go within Snowflake to get started immediately.

How to access Cortex Code

In Snowsight, the default path is Projects » Workspaces, open a SQL file or notebook, then click the Cortex Code icon in the lower-right (small white star with blue background). In CLI, install Cortex Code, run cortex, then use /status to verify role, warehouse, database, and schema. For semantic-layer work, go to AI & ML » Cortex Analyst. For data quality, go to Catalog » Database Explorer » [object] » Data Quality » Monitoring. For Airflow, use Cortex Code CLI with /airflow or cortex airflow …. (Snowflake Docs)


Now that you’re in, here are 10 ways you can use Cortex Code in ways to improve your existing processes.

1. Find the right tables and columns without already knowing object names

When someone is new to a dataset, a business domain, or an unfamiliar Snowflake environment, one of the first challenges is simply figuring out where the relevant data lives and which objects are actually useful.

Traditional way: search Database Explorer, inspect schemas manually, ask teammates, and guess at table names.

With Cortex Code: ask plain-English metadata questions like “Where can I find tables related to customer churn and subscription status?” or “Find all tables related to customers that I have write access to.” In Snowsight, readers can add objects as context with @; in CLI, they can pull schema and sample rows into context with #FULLY_QUALIFIED_TABLE.

Best place to do it: Workspaces or CLI.

Key Link: Cortex Code Example Prompts

2. Audit PII, permissions, lineage, and governance from natural language

Data teams often need to answer governance questions quickly, whether you are preparing for an audit, validating data access, identifying sensitive data, or understanding how information flows across the environment.

Traditional way: hand-write ACCOUNT_USAGE queries, join governance metadata manually, and interpret RBAC or classification results yourself.

With Cortex Code: Snowflake’s built-in governance skills let users ask questions like “Find all tables that have PII in them,” “List every table tagged PII = TRUE in ANALYTICS_DB,” or “Show the lineage from RAW_DB.ORDERS to downstream dashboards.” Snowflake explicitly says these governance skills run against Snowflake metadata and account usage patterns automatically.

Best place to do it: Snowsight or CLI; for extending the blog into quality monitoring, show the path Catalog » Database Explorer » object » Data Quality » Monitoring.

Key Link: The Data governance skills for Cortex Code site

3. Generate first-draft SQL from a business question

When you start with a business question instead of a finished query, what you really need is a fast way to turn that question into usable SQL you can validate and refine.

Traditional way: translate the question into joins, filters, windows, and aggregation logic by hand.

With Cortex Code: users can start with prompts like “Write a query for top 10 customers by revenue and a 7-day moving average,” then refine from there. Snowflake documents this as a core SQL generation workflow in both Snowsight and CLI.

Best place to do it: Workspaces if the user wants an editable SQL file and diff review; CLI if they want the result immediately in terminal.

Key Link: Snowsight example prompts.

4. Explain, refactor, and optimize SQL that already exists

When you inherit a query that is hard to follow, poorly documented, or slow to run, your first priority is usually understanding what it does before you try to improve it.

Traditional way: open query history, inspect execution patterns, rewrite SQL, and test changes manually.

With Cortex Code: readers can ask “What does this SQL script do?” or “Explain why this query is slow and optimize it,” and review the resulting diff before applying changes. Snowflake explicitly highlights logic explanation, performance optimization, and visual diff review as part of the product.

Best place to do it: Workspaces, because the code-aware diff flow is strongest there.

Key Link: AI Code Suggestions (currently in Preview)

5. Generate synthetic data for demos, testing, and proof-of-concepts

When production data is unavailable, restricted, too sensitive, or simply not ready, you still need realistic sample data to build, test, and demonstrate against.

Traditional way: use Faker, Python scripts, spreadsheets, or ad hoc inserts, then clean the result before loading it.

With Cortex Code: Snowflake’s official CLI workflows include prompts for generating realistic synthetic fraud, pharma, and telecom churn datasets, including large synthetic customer datasets and uploading them into Snowflake. This is a very practical “fast start” use case for teams that want to prototype before production data is ready.

Best place to do it: CLI.

Key Link: Cortex Code workflow examples

6. Build notebooks for EDA, visualization, and ML experimentation

When you are exploring data, testing ideas, or developing models, you need a workspace where you can combine queries, code, commentary, and visuals without having to build everything from scratch.

Traditional way: create notebook structure manually, wire SQL and Python cells, add markdown, install or verify packages, and script plots yourself.

With Cortex Code: Snowflake says Cortex Code in Notebooks can create and manage notebooks, add/reorder SQL/Python/Markdown cells, generate visualization code, and run a notebook or specific cells. Snowflake also publishes official examples for data analysis, quantitative research, and agentic ML pipelines.

Best place to do it: Projects » Workspaces, inside a notebook.

Key Link: Cortex Code in Notebooks

7. Scaffold dbt models, tests, incremental logic, and docs

When you are building out a transformation layer, you need to move quickly from raw source data to structured models, while also making sure the logic is tested and documented well enough for others to trust and maintain.

Traditional way: inspect raw tables, author sources and models, write tests, tune incremental logic, run builds, and document everything manually.

With Cortex Code: Snowflake documents support across the dbt lifecycle: exploring sources, scaffolding staging/intermediate models, building multi-model DAGs and metrics, adding tests, converting models to incremental logic, running dbt commands, and generating project docs. There are also official demos and best-practice guides showing local dbt and Snowflake-native dbt workflows.

Best place to do it: Workspaces for dbt Projects on Snowflake, or CLI for local dbt repos.

Key Link: Cortex Code agent for dbt Projects

8. Turn analysis into a Streamlit dashboard or app

Your insights become much more valuable when you can package them into something business users, operators, or executives can actually interact with.

Traditional way: move from SQL to app code manually, wire filters and visuals, test locally, then deploy separately.

With Cortex Code: Snowflake’s workflow examples explicitly show prompting for an interactive Streamlit dashboard with filters and charts, then prompting Cortex Code to make sure it works in Snowflake and upload it. Snowflake also has official guides for customer review dashboards, REST onboarding apps, and other Streamlit-based Cortex applications.

Best place to do it: CLI for app generation and deployment, though Workspaces can still help with supporting SQL/notebook work.

Key Link: Build a Chatbot App with Streamlit and Snowflake Cortex

9. Create semantic views so business users can ask better questions later

When definitions vary across teams, you need a semantic layer that makes your core business metrics more consistent, reusable, and trustworthy.

Traditional way: model the semantic layer by hand in YAML or SQL, validate relationships, then iterate with analysts.

With Cortex Code: Snowflake’s own examples show prompts like “Write a Semantic View named … for Cortex Analyst based on this data. Use the semantic-view optimization skill,” and “Identify errors in my semantic model at @models/revenue.yaml.” For a UI-native flow, Snowflake’s semantic view docs direct users to AI & ML » Cortex Analyst » Create new » Create new Semantic View.

Best place to do it: Cortex Code for drafting/debugging, then AI & ML » Cortex Analyst for managed semantic-view workflows.

Key Link: Mastering Semantic Views and Cortex Agents with Cortex Code

10. Build an agent that combines structured and unstructured data

When you want to move beyond static reporting, you may be ready to create experiences where AI can retrieve information, reason across sources, and support real workflows.

Traditional way: separately stand up retrieval, structured analytics, prompt orchestration, tool routing, and evaluation.

With Cortex Code: Snowflake’s official workflow shows creating a semantic view for Cortex Analyst, generating customer-call PDFs, parsing them into text, creating a Cortex Search service, and then building a Cortex Agent that uses both Analyst and Search. Snowflake’s agent docs and multi-tool agent guide reinforce this exact pattern.

Best place to do it: CLI for the end-to-end build workflow; later expose the result through Snowflake Intelligence or app surfaces.

Key Link: Cortex Agents tutorials

Additional Resources

For some extra help, here are some additional links to check out if you’re just beginning to learn about Cortex Code.

  • Getting Started with Cortex Code for Data Analysis for analyst-friendly examples. (Snowflake)
  • Agentic Machine Learning Best Practices with Cortex Code for the ML/data science angle. (Snowflake)
  • Best Practices for Cortex Code CLI for dbt, Airflow, semantic views, and safe working patterns. (Snowflake)
  • Using Apache Airflow with Cortex Code CLI for the orchestration/debugging story. (Snowflake Docs)
  • Snowflake Developers demos for rapid exploration, dbt, and Airflow proof points. (youtube.com)

Start small, dream big, start playing. Soon enough, you’ll never go back to how you’re doing things today.

Martin Feehan

Author

Avatar photo
Email:

Share on:

Recent Insights

7Rivers CTA
Button

You might also be interested in...

How Snowflake Cortex Enables Secure Generative AI Inside Your Data Cloud

As organizations race to adopt generative AI, a critical question continues to surface: how can you unlock AI’s potential

On the River with Marcos, 7Rivers AI Accelerator & Agent: May Expedition

https://www.youtube.com/watch?v=3bdLxhqgbgc&feature=youtu.be On the River with Snowflake Updates: May 2026 Edition Hey folks, it’s Marcos back on the river with

From Data to Value: Deploying Snowflake Intelligence to Align AI with Business Outcomes

The Gap Between Data and Business Value Most enterprises have invested in collecting and storing data, but few have

Ready to Lead the Future with AI?

No matter where you are in your AI and data journey, 7Rivers is here to guide you.