Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Se você não ativar o faturamento do projeto do Google Cloud usado neste tutorial, será necessário fazer upload e trabalhar com dados no sandbox do BigQuery. O sandbox do BigQuery ensina você
a usar o BigQuery com um conjunto limitado
de recursos sem custos financeiros.
No campo Pesquisar fontes de dados, digite public datasets
e pressione Enter.
Clique em Conjuntos de dados públicos.
Selecione um conjunto de dados e clique em Ver conjunto de dados.
No painel Explorer, seu conjunto de dados está selecionado, e é possível consultar os detalhes.
Opcional: confira mais opções clicando em more_vertVer ações ao lado do conjunto de dados.
Cada conjunto de dados contém tabelas, que podem ser acessadas clicando em
arrow_rightAlternar nó ao lado de qualquer conjunto de dados.
consulte um conjunto de dados público
Nas etapas a seguir, você vai consultar o conjunto de dados público "USA Names" para determinar
os nomes mais comuns nos Estados Unidos entre 1910 e 2013:
No console do Google Cloud, acesse a
página do BigQuery.
Se a consulta for válida, uma marca de seleção é exibida com a quantidade de
dados que são processados pela consulta. Se a consulta for inválida, um
ponto de exclamação será exibido com uma mensagem de erro.
Clique em
Executar.
Os nomes mais comuns estão listados na seção Resultados da consulta.
A linha do cabeçalho da tabela contém cada nome de coluna selecionado na
consulta.
Opcional: para exibir a duração e a quantidade de dados que a consulta
processou,
clique na guia Informações do job nos Resultados da consulta.
Limpeza
Para evitar cobranças na conta do Google Cloud pelos
recursos usados nesta página, siga estas etapas.
Excluir o projeto
Se você usou o sandbox do BigQuery para consultar
o conjunto de dados público, o faturamento não está ativado para seu projeto.
O jeito mais fácil de evitar o faturamentos é excluindo o projeto criado para este tutorial.
Para excluir o projeto:
In the Google Cloud console, go to the Manage resources page.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 UTC."],[[["\u003cp\u003eThis guide explains how to locate and query public datasets in BigQuery using the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting, you must enable billing for your Google Cloud project or use the BigQuery sandbox, which provides a limited, free environment.\u003c/p\u003e\n"],["\u003cp\u003eYou can access public datasets within the Google Cloud console by searching for "public datasets" in the \u003cstrong\u003eExplorer\u003c/strong\u003e pane.\u003c/p\u003e\n"],["\u003cp\u003eA step-by-step process is provided to run a SQL query against the "USA Names" public dataset to find the most common names between 1910 and 2013.\u003c/p\u003e\n"],["\u003cp\u003eThe tutorial covers how to delete the entire project to avoid incurring charges, as well as alternative options to preserve project IDs if necessary.\u003c/p\u003e\n"]]],[],null,["# Query a public dataset and visualize the results using BigQuery Studio\n======================================================================\n\nLearn how to query a public dataset and visualize the results by using\nBigQuery Studio.\n\n*** ** * ** ***\n\nTo follow step-by-step guidance for this task directly in the\nGoogle Cloud console, click **Guide me**:\n\n[Guide me](https://console.cloud.google.com/freetrial?redirectPath=/?walkthrough_id=bigquery--bigquery-quickstart-query-public-dataset)\n\n*** ** * ** ***\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n Make sure that you have the following role or roles on the project:\n\n BigQuery Job User, Service Usage Admin\n\n #### Check for the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3.\n In the **Principal** column, find all rows that identify you or a group that\n you're included in. To learn which groups you're included in, contact your\n administrator.\n\n 4. For all rows that specify or include you, check the **Role** column to see whether the list of roles includes the required roles.\n\n #### Grant the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3. Click person_add **Grant access**.\n 4.\n In the **New principals** field, enter your user identifier.\n\n This is typically the email address for a Google Account.\n\n 5. In the **Select a role** list, select a role.\n 6. To grant additional roles, click add **Add\n another role** and add each additional role.\n 7. Click **Save**.\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n\n Make sure that you have the following role or roles on the project:\n\n BigQuery Job User, Service Usage Admin\n\n #### Check for the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3.\n In the **Principal** column, find all rows that identify you or a group that\n you're included in. To learn which groups you're included in, contact your\n administrator.\n\n 4. For all rows that specify or include you, check the **Role** column to see whether the list of roles includes the required roles.\n\n #### Grant the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3. Click person_add **Grant access**.\n 4.\n In the **New principals** field, enter your user identifier.\n\n This is typically the email address for a Google Account.\n\n 5. In the **Select a role** list, select a role.\n 6. To grant additional roles, click add **Add\n another role** and add each additional role.\n 7. Click **Save**.\n\n1.\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n2. If you don't enable billing for the Google Cloud project that you use in this tutorial, then you query the public data in the BigQuery sandbox. The BigQuery sandbox lets you learn BigQuery with a limited set of BigQuery features at no charge.\n3. Ensure that the BigQuery API is enabled.\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=bigquery)\n\n If you created a new project, the BigQuery API is automatically\n enabled.\n\n\u003cbr /\u003e\n\nView a public dataset\n---------------------\n\nBigQuery public datasets are available by default in\nBigQuery Studio in a project named `bigquery-public-data`. In this\ntutorial you query the NYC Citi Bike Trips dataset. Citi Bike is a large bike\nshare program, with 10,000 bikes and 600 stations across Manhattan, Brooklyn,\nQueens, and Jersey City. This dataset includes Citi Bike trips since Citi Bike\nlaunched in September 2013.\n\n1. In the Google Cloud console, go to the **BigQuery Studio** page.\n\n [Go to BigQuery Studio](https://console.cloud.google.com/bigquery)\n2. In the **Explorer** pane, click\n **addAdd data**.\n\n3. In the **Add data** dialog, in the **Filter By** pane, click\n **Public datasets**.\n\n4. On the **Marketplace** page, in the **Search Marketplace** field, type `NYC\n Citi Bike Trips` to narrow your search.\n\n5. In the search results, click **NYC Citi Bike Trips**.\n\n6. On the **Product details** page, click **View dataset** . You can view\n information about the dataset on the **Details** tab.\n\nQuery a public dataset\n----------------------\n\nIn the following steps, you query the `citibike_trips` table to determine the\n100 most popular Citi Bike stations in the NYC Citi Bike Trips public dataset.\nThe query retrieves the station's name and location, and the number of\ntrips that started at that station.\n\nThe query uses the [ST_GEOGPOINT function](/bigquery/docs/reference/standard-sql/geography_functions#st_geogpoint)\nto create a point from each station's longitude and latitude parameters and\nreturns that point in a `GEOGRAPHY` column. The `GEOGRAPHY` column is used to\ngenerate a heatmap in the integrated geography data viewer.\n\n1. In the Google Cloud console, open the\n **BigQuery Studio** page.\n\n [Go to BigQuery Studio](https://console.cloud.google.com/bigquery)\n2. Click add_box\n **SQL query**.\n\n3. In the query editor, enter the following\n query:\n\n SELECT\n start_station_name,\n start_station_latitude,\n start_station_longitude,\n ST_GEOGPOINT(start_station_longitude, start_station_latitude) AS geo_location,\n COUNT(*) AS num_trips\n FROM\n `bigquery-public-data.new_york.citibike_trips`\n GROUP BY\n 1,\n 2,\n 3\n ORDER BY\n num_trips DESC\n LIMIT\n 100;\n\n If the query is valid, then a check mark appears along with the amount of\n data that the query processes. If the query is invalid, then an\n exclamation point appears along with an error message.\n\n\n4. Click\n **Run**.\n The most popular stations are listed in the\n **Query results**\n section.\n\n\n5. Optional: To display the duration of the job and the amount of data that the\n query job processed, click the **Job information** tab in the **Query\n results** section.\n\n6. Switch to the **Visualization**\n tab. This tab generates a map to quickly visualize your results.\n\n7. In the **Visualization configuration** panel:\n\n 1. Verify that **Visualization type** is set to **Map**.\n 2. Verify that **Geography column** is set to **`geo_location`**.\n 3. For **Data column** , choose **`num_trips`**.\n 4. Use the add **Zoom in** option to reveal the map of Manhattan.\n\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\n### Delete the project\n\nIf you used the [BigQuery sandbox](/bigquery/docs/sandbox) to query\nthe public dataset, then billing is not enabled for your project, and you don't\nneed to delete the project.\n\n\nThe easiest way to eliminate billing is to delete the project that you\ncreated for the tutorial.\n\nTo delete the project:\n\n| **Caution** : Deleting a project has the following effects:\n|\n| - **Everything in the project is deleted.** If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.\n| - **Custom project IDs are lost.** When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.\n|\n|\n| If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects\n| can help you avoid exceeding project quota limits.\n1. In the Google Cloud console, go to the **Manage resources** page.\n\n [Go to Manage resources](https://console.cloud.google.com/iam-admin/projects)\n2. In the project list, select the project that you want to delete, and then click **Delete**.\n3. In the dialog, type the project ID, and then click **Shut down** to delete the project.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\n- Learn about the [BigQuery sandbox](/bigquery/docs/sandbox).\n- Learn [how to create a dataset, load data, and query tables in\n BigQuery Studio](/bigquery/docs/quickstarts/load-data-console)."]]