# How do I connect to BigQuery public datasets?

**URL:** <https://community.omni.co/t/how-do-i-connect-to-bigquery-public-datasets/59>\
**Category:** Modeling\
**Tags:** connections, bigquery\
**Created:** [May 10, 2024, 2:39pm UTC](https://community.omni.co/t/how-do-i-connect-to-bigquery-public-datasets/59 "2024-05-10T14:39:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![conor](https://yyz2.discourse-cdn.com/flex004/user_avatar/community.omni.co/conor/32/45_2.png) [@conor](https://community.omni.co/u/conor)\
**Post date:** [May 10, 2024, 2:39pm UTC](https://community.omni.co/t/how-do-i-connect-to-bigquery-public-datasets/59/1 "2024-05-10T14:39:29Z")

</div>

The [BigQuery public datasets](https://console.cloud.google.com/marketplace/browse?filter=solution-type:dataset&q=public%20data&_ga=2.248946247.1574387220.1715344991-2028414673.1712097911) provides a helpful repository of open access datasets to connect to if you don’t have your own data available to connect yet.

In Omni we can create connections to and query these datasets if you follow the steps below (Omni’s documentation for connecting to BigQuery can be found [here](https://docs.omni.co/connections/database/bigquery#creating-a-bigquery-service-account):

1. Create a BigQuery service account according to [these steps](https://docs.omni.co/connections/database/bigquery#creating-a-bigquery-service-account), note you must have Google Cloud admin permissions to create a service account.
2. In your Omni instance, to add a BigQuery connection:  
(i) Navigate to the Admin tab.  
(ii) Select `Connections` menu option on the left hand panel  
(iii) Select the `Add Connection` button in the top right  
(iV). Select the `BigQuery` button

 ![From the Omni Admin page add a connection](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/a74e9bfa0a064360f4541f80d8ded1a54f520ea7.png)

1. Fill out the connection details for your BigQuery connection (Further Omni [Documentation Available for setting up the BigQuery Connection](https://docs.omni.co/connections/database/bigquery#creating-the-connection-in-omni)). In this example, connecting to a public dataset you can either set the **Default Dataset** or **Include Other Projects** to `bigquery-public-data`. If you want to main connection to be to the public dataset use the former and if you plan on using this connection for your own database then it’s best to include the `bigquery-public-data` in **Include Other Projects**.  
Once you’ve filled in all the details, you can update and test the connection and wait for it to complete successfully.

 ![Screenshot 2024-05-10 at 15.24.11](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/ff6e840fedd9b52499f2426c37e506e0fa006a2b.png)

1. We’ll use the [US Bureau census data](https://console.cloud.google.com/marketplace/product/united-states-census-bureau/us-census-data). The `data-catalog`.`schema`.`table` is highlighted in the screenshot below.  
 ![Finding the project, schema and table name in the google cloud console](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/c3501ea08604176ae090af9bfdc66f08bf97f258.png)  
Navigate back to the workbook environment. You can query this table in Omni by writing the SQL query directly and running it. Clicking on the SQL button will open the SQL editor which you can edit in. Pressing the play button (shortcut CMD+Enter) will run your query.  
 ![Screenshot 2024-05-10 at 15.04.10](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/b8db2e61a8d0c771bf4d163cf1454b5e115cc684.png)

The SQL query running here is:

```sql
SELECT * FROM `bigquery-public-data.census_bureau_usa.population_by_zip_2000`

```

**Note** do not apply any LIMIT in the query.

1. Save this query as a view and name it.

 ![Save the query as a view](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/af5bebe01e2bf8057102c5fc85883c57a6976de0.png)

1. It’s now available for us as a table in the field picker.  
 ![Public dataset available in field picker](https://canada1.discourse-cdn.com/flex004/uploads/omni/original/1X/0449ea60ff365e1e545bd6290586d3deb8e1fbcf.png)
