> For the complete documentation index, see [llms.txt](https://datalab-docs.datacamp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://datalab-docs.datacamp.com/connect-to-data/bigquery.md).

# Google BigQuery

## Set up a BigQuery warehouse

If you already have a BigQuery warehouse set up, you can skip this step.

* Visit <https://console.cloud.google.com>
* In the search bar, look for BigQuery
* Go through one of the guides to "Add your own data".
* You can test that things work by querying the resulting dataset table.

<figure><img src="/files/imvQ8TI1GlKN1nKGhA88" alt=""><figcaption></figcaption></figure>

#### Configure a Google Service Account

A Google service account is a special kind of account that can be used by programs to access Google resources like a BigQuery data warehouse. You will use this service account to connect DataCamp DataLab to your BigQuery warehouse.

To set up a new Google Service Account, please refer to [this excellent guide](https://docs.openbridge.com/en/articles/1856793-how-to-set-up-google-bigquery-creating-and-configuring-service-accounts-in-google-cloud-console). At the end of it, you'll have the JSON credentials file that you can use to set up the BigQuery connection in DataLab.

## Set up a Google BigQuery connection

When inside a workbook, click **View** > **Databases**, then click the **+** icon and follow the on-screen instructions. Upload the Service Account JSON and hit "Connect".

<figure><img src="/files/MBkwn4j4Pq6b3uHnrRLj" alt=""><figcaption><p>Create a BigQuery connection</p></figcaption></figure>

For detailed instructions, see [Connect your data to DataLab](/connect-to-data/connect-your-data-to-workspace.md).

## Query the database

You can now query the BigQuery data warehouse with a [SQL cell](/work/sql-cell.md). Select it in the **Select source** dropdown in the top left corner of a SQL cell, or select the sample BigQuery data warehouse.

<figure><img src="/files/ZPWKDfmRi7TrgCCPLJWL" alt=""><figcaption><p>Example of a SQL cell using the <code>BigQuery Integration</code> connection. The query result is available as <code>df</code>.</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://datalab-docs.datacamp.com/connect-to-data/bigquery.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
