Custom queries in BigQuery

This page explains how to set up and view prebuilt reports in BigQuery.

In Google Cloud console, you can write your custom query based on the table name or prebuilt report and save it as a query or as a view.

Write custom queries in BigQuery as a query

To write custom queries in BigQuery as a query, do the following:

  1. In the Google Cloud console, go to the BigQuery Studio page:

    Go to BigQuery Studio page

  2. In the Explorerpanel, expand your project and select a dataset.
  3. Click the dataset name to expand it.

    The tables and views in the dataset appear.

  4. Click the table name or a prebuilt report.

    The Detailstab displays the table's description and the Schematab displays the table's schema definition.

  5. Click Queryand select either In new tabor In split tab.

    A new tab opens with a sample query.

  6. Write a query based on the field names that are populated in the Schematab.

  7. Click Run. This displays the preview of the query results.

  8. Click Save query.

  9. In the Save querydialog, type a name for the saved query.

You can download and save queries to the selected location. For more information, see Downloading and saving query results from the Google Cloud console .

Write custom queries in BigQuery as a view

To write custom queries in BigQuery as a view, do the following:

  1. In the Google Cloud console, go to the BigQuery Studio page:

    Go to BigQuery Studio page

  2. In the Explorerpanel, expand your project and select a dataset.
  3. Click the dataset name to expand it.

    The tables and views in the dataset appear.

  4. Click the table name or a prebuilt report.

    The Detailstab displays the table's description and the Schematab displays the table's schema definition.

  5. Click Queryand select either In new tabor In split tab.

    A new tab opens with a sample query.

  6. Write a query based on the field names that are populated in the Schematab.

  7. Click Run. This displays the preview of the query results.

  8. Click Save view.

  9. In the Save viewdialog, do the following:

    1. In the Projectlist, click Browseand select a project.
    2. In the Datasetlist, select a dataset to store the view. The dataset that contains your view and the dataset that contains the tables referenced by the view must be in the same location .
    3. In Table name, enter a name for the view.
    4. Click Save.

You can download and save queries to the selected location. For more information, see Downloading and saving query results from the Google Cloud console .

What's next

Design a Mobile Site
View Site in Mobile | Classic
Share by: