How to automatically write dbt SQL queries using AI

With AI Data Sidekick, you can use artificial intelligence to ✨automatically✨ write SQL queries in dbt Cloud.

Published on Jan 17, 2024 by AirOps Team

Analytics engineers spend the majority of their days working with SQL inside of dbt. Repetitive tasks, like writing queries, add up over time. 

That’s why AirOps created an AI-assisted tool that takes the manual labor out of writing SQL in dbt Cloud.

Automatically write SQL in dbt Cloud using AI

Data Sidekick combines the power of AI with context from your data warehouse to take the grunt work out of common data tasks, including writing SQL. 

You can ask a question using natural language and immediately get a properly formatted SQL query to input into dbt Cloud.

In addition to drafting dbt SQL queries, you can also use Sidekick’s collection of AI-powered data apps to:

  • Auto document table schemas ✍️
  • Generate a full Python script from a dbt model 🐍
  • Optimize queries to improve speed and trim your warehouse bill 💸
  • Suggest questions a specific database table can answer 🧐

… and more. We’re always developing new AI data apps, too. 

The best part? Sidekick is completely free for individual users. 

Discover AirOps AI Apps

Powerful AI apps you can customize & run at scale: write SQL, run NLP, draft personalized content, and more.

See Data Sidekick in action

Curious about how Sidekick performs in the wild? See what Kyle Dempsey, Head of CX and Solutions Architecture at AirOps, has to say about using it to automatically write SQL queries in dbt.

How does Sidekick help analysts improve their dbt workflows?
Many data analysts spend the majority of their day working in a tool like dbt.

While dbt users tend to know SQL well, the time it takes to finish repetitive tasks like listing field names, writing standard joins, and performing simple data manipulation tasks (like truncating a date) adds up. Then there’s analysts who are less familiar with dbt. For them, the combination of SQL and Jinja can be a bit confusing.

Sidekick makes things infinitely easier. It understands the structure of your data and uses those tables to generate a SQL query based on a natural language prompt. The dbt SQL recipe will even format the query correctly using dbt syntax, so you can use it directly inside of dbt Cloud.
How much time does Sidekick save you?
I’d estimate that using Sidekick to write my dbt SQL queries saves me anywhere from 30 seconds to 30 minutes per query.

Discover AirOps AI Apps

Powerful AI apps you can customize & run at scale: write SQL, run NLP, draft personalized content, and more.