Yum News Yum News

Technology  ·  Artificial Intelligence  ·  Developer Insights

Breaking
Gemini Task Automation Guide: India UK Japan Apps ✦   How to Set Up ChatGPT Wallet for Agent Purchases ✦   How to Set Up and Use Gemini Live on Apple CarPlay ✦   How to Set Up Gemini Live on Apple CarPlay ✦   How to Use the Gemini Decisions API for Fast Choices ✦   How to Use Gemini Task Automation on Pixel Phones   ✦   Gemini 3.8 Live launches with native audio dialogue  ✦  Android September Drop adds Find Hub memory  ✦  ML Kit now supports Gemini Nano on-device inference
How to Analyze Data with Gemini in BigQuery
ai-toolstutorialsgoogle

How to Analyze Data with Gemini in BigQuery

Step-by-step guide to using Gemini in BigQuery for SQL generation, query explanations, data insights, and forecasting models.

Gemini in BigQuery turns natural language into SQL, explains complex queries, and surfaces patterns in your tables. You open BigQuery Studio, turn on the Gemini features, and start prompting. The same workflow works for one-off analysis or building forecasting models with BigQuery ML.

This guide shows the exact steps using official Google Cloud tools. You need a Google Cloud project with BigQuery enabled and billing set up if you move past the free tier.

Enable Gemini in BigQuery

Open the BigQuery console. In the toolbar, click the Gemini icon (the sparkle). Enable these options:

  • Auto-completion
  • Auto-generation
  • Explanation

These settings activate the SQL generation tool, query explanations, and data insights. Gemini uses your table metadata and query history for context but does not train models on your data.

Analyst reviewing data dashboards on a laptop

Generate and explain SQL

Create a new query tab. Click the Gemini button next to the editor and choose “Generate SQL with Gemini.” Enter a plain-English prompt such as:

“Show daily total sales by product from the thelook_ecommerce dataset, joining order_items and products.”

Gemini returns a complete SQL statement. Review the joins and filters, then run it. If the result needs changes, highlight the query and use “Transform with Gemini.” Type “order by total sales descending” and insert the updated version.

To understand an existing query, highlight it and select “Explain with Gemini.” The tool returns a plain-language summary of the logic, joins, and calculations.

Get data insights

Select a table in the Explorer panel. Open the Insights tab. Click “Generate insights.” Gemini scans the schema and sample data, then proposes ready-to-run queries that highlight distributions, outliers, and relationships.

These suggestions help when you are new to a dataset. Copy any query into the editor and run it. You can also ask follow-up questions in the Cloud Assist chat panel.

Build a simple forecast

For time-series data, create a BigQuery ML model. Prompt Gemini with:

“Create a forecasting model for weekly sales using ARIMA_PLUS on the sales table.”

Gemini generates the CREATE MODEL statement. Run it. Once training finishes, ask:

“Write a query that returns the next 12 weeks of forecasts from the model.”

Review the ML.FORECAST results and visualize them in Looker Studio or the built-in chart options.

Team collaborating around data visualizations

Tips for better results

  • Add clear column descriptions to your tables. Gemini uses them for more accurate SQL.
  • Start with small date ranges or LIMIT clauses while testing prompts.
  • Use the Cloud Assist chat for broader questions such as “How do I join these three tables?”
  • Check costs in the BigQuery job details; Gemini-assisted queries still bill as regular query or ML jobs.

If you already work with Gemini agents in Workspace, the same objective-based prompting style applies here. For Android-focused AI features, see the guide on adding Gemini 3.8 Flash to Android apps.

Sources

Share this story