Gemini Enterprise lets you analyze structured data in BigQuery tables by asking questions in natural language. When you submit a prompt, Gemini Enterprise translates your question into SQL, runs it against tables that you can access, and returns the results.
Before you begin
Before you query BigQuery tables in Gemini Enterprise, complete the following setup:
- Confirm that your Gemini Enterprise administrator has connected BigQuery in federated query mode and attached the data store to your Gemini Enterprise app. Your administrator must also enable the required connector actions: Execute SQL (Read-Only) and Get Table Info.
- In the chat box, click Connectors and turn on BigQuery.
- To get faster, focused results, turn off other connectors and Google Search.
Required roles
To get the permissions that you need to query BigQuery tables through Gemini Enterprise, ask your administrator to grant you the following IAM roles:
- BigQuery Job User (
roles/bigquery.jobUser) on the billing or compute Google Cloud project - BigQuery Data Viewer (
roles/bigquery.dataViewer) on the storage Google Cloud project
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Because queries run using your credentials, BigQuery enforces your Identity and Access Management (IAM) permissions and row-level security. Running queries in federated query mode incurs BigQuery compute costs in your billing Google Cloud project.
Example prompt
In the chat box, enter a prompt naming a fully qualified BigQuery table that you can access, such as a table in your Google Cloud project or a BigQuery public dataset:
Using the PROJECT_ID.DATASET_NAME.TABLE_NAME table,
find the top five best-selling Cymbal Superstore locations in 2025. Include the
store number, city, state, and total sales in a ranked table.
Replace the following:
PROJECT_ID: the ID of the Google Cloud project that contains the table, such asmy-project.DATASET_NAME: the name of the BigQuery dataset, such asretail_sales.TABLE_NAME: the name of the BigQuery table that you have permission to access, such asstore_sales.
Example output
In response to this prompt, Gemini Enterprise produces output similar to the following:
Based on the 2025 sales data, the following table lists the top five best-selling Cymbal Superstore locations:
Rank Store number City State Total sales 1 1042 Chicago IL $4,825,400 2 2087 Seattle WA $4,310,950 3 1154 Austin TX $3,982,120 4 3019 Denver CO $3,645,780 5 1890 Atlanta GA $3,418,650
After Gemini Enterprise returns a response, you can expand the Tool activity section to inspect the generated SQL query and tool details. To export the table to Google Sheets, click Export to Sheets. For more information, see Export to Google Docs and Google Sheets.