每个公共数据集都存储在一个特定位置,例如 US 或 EU。目前,BigQuery 示例表存储在 US 多区域位置。在查询示例表时,请在命令行中提供 --location=US 标志,在 Google Cloud 控制台中选择 US 作为处理位置,或者在使用 API 时,在作业资源的 jobReference 部分中指定 location 属性。由于示例表存储在 US,因此您无法将示例表查询结果写入另一区域中的表,也无法将示例表与其他区域中的表连接。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eBigQuery public datasets are datasets hosted by BigQuery that are available for public access, allowing users to run queries with the first 1TB per month free.\u003c/p\u003e\n"],["\u003cp\u003eThese datasets can be accessed via the Google Cloud console, the bq command-line tool, or through the BigQuery REST API and its client libraries.\u003c/p\u003e\n"],["\u003cp\u003ePublic datasets are stored in specific locations (like US or EU), and users must specify the correct location when querying the data.\u003c/p\u003e\n"],["\u003cp\u003eIn addition to the public datasets, BigQuery provides sample tables that users can query as a supplement, with similar requirements for querying.\u003c/p\u003e\n"],["\u003cp\u003eUsers can share their datasets publicly by adjusting access controls, with storage costs for these shared datasets incurred by the dataset's host while query costs are applied to the querying project.\u003c/p\u003e\n"]]],[],null,["# BigQuery public datasets\n========================\n\nA public dataset is any dataset that is stored in BigQuery and\nmade available to the general public through the\n[Google Cloud Public Dataset Program](/datasets).\nThe public datasets are datasets that BigQuery hosts for\nyou to access and integrate into your applications. Google pays for the storage\nof these datasets and provides public access to the data using a\n[project](/docs/overview#projects). You pay only for the queries\nthat you perform on the data. The first 1 TB per month is free, subject to\n[query pricing details](/bigquery/pricing#analysis_pricing_models).\n\nPublic datasets are available for you to analyze using either\nlegacy SQL or\n[GoogleSQL](/bigquery/docs/reference/standard-sql/query-syntax)\nqueries. Use a fully qualified table name when querying public datasets, for\nexample `bigquery-public-data.bbc_news.fulltext`. If your organization restricts\ndata access, for example with security perimeters, then you might need to\ncontact your administrator for permission to access public datasets.\n\nYou can access BigQuery\npublic datasets by using the\n[Google Cloud console](https://console.cloud.google.com/marketplace/partners/bigquery-public-data),\nby using the [bq command-line tool](/bigquery/docs/cli_tool), or by\nmaking calls to the [BigQuery REST API](/bigquery/docs/reference/v2)\nusing a variety of\n[client libraries](/bigquery/docs/reference/libraries)\nsuch as\n[Java](https://developers.google.com/api-client-library/java/apis/bigquery/v2),\n[.NET](https://developers.google.com/api-client-library/dotnet/get_started),\nor [Python](https://developers.google.com/api-client-library/python/).\nYou can also [view and query public datasets through\nBigQuery sharing (formerly Analytics Hub)](/bigquery/docs/analytics-hub-view-subscribe-listings#view_listings),\na data exchange platform that helps you discover and access data libraries.\n\nPublic datasets are not accessible by default from within a\n[VPC Service Controls](/vpc-service-controls/docs/overview) perimeter. There\nis no service-level agreement (SLA) for the Public Dataset Program.\n\n[Go to Sharing (Analytics Hub)](https://console.cloud.google.com/bigquery/analytics-hub)\n\nYou can find more details about each individual dataset\nby clicking the dataset's name in the Datasets section of\nCloud Marketplace.\n\n[Go to Datasets in Cloud Marketplace](https://console.cloud.google.com/marketplace/browse?filter=solution-type:dataset)\n| **Note:** The **Last Updated** date on a Cloud Marketplace dataset page indicates when the dataset page was last updated. To find out when the data itself was last updated, see [Accessing public datasets in the Google Cloud console](#public-ui).\n\nBefore you begin\n----------------\n\nTo get started using a BigQuery public dataset, you must create or select a\nproject. The first terabyte of data processed per month is free, so you can start querying public\ndatasets without enabling billing. If you intend to go beyond the\n[free tier](/bigquery/pricing#free-tier), you must also enable billing.\n\nSign 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\nIn the Google Cloud console, on the project selector page,\nselect or create a Google Cloud project.\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[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\n\nEnable the BigQuery API.\n\n\n[Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=bigquery) \nIn the Google Cloud console, on the project selector page,\nselect or create a Google Cloud project.\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[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\n\nEnable the BigQuery API.\n\n\n[Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=bigquery)\n1. BigQuery is automatically enabled in new projects. To activate BigQuery in a preexisting project,\n\n\n Enable the BigQuery API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=bigquery)\n\nPublic dataset locations\n------------------------\n\nEach public dataset is stored in a specific location like `US` or\n`EU`. Currently, the BigQuery sample tables are stored in the\n`US` multi-region [location](/bigquery/docs/locations).\nWhen you query a sample table, supply the `--location=US` flag on the\ncommand line, choose `US` as the processing location in the\nGoogle Cloud console, or specify the `location` property in the\n`jobReference` section of the\n[job resource](/bigquery/docs/reference/rest/v2/jobs)\nwhen you use the API. Because the sample tables are stored in the US, you cannot\nwrite sample table query results to a table in another region, and you cannot\njoin sample tables with tables in another region.\n\nAccess public datasets in the Google Cloud console\n--------------------------------------------------\n\nYou can access public datasets in the\n[Google Cloud console](https://console.cloud.google.com/bigquery)\nthrough the following methods:\n\n- In the [**Explorer**](/bigquery/docs/bigquery-web-ui#explorer_panel) pane,\n view the `bigquery-public-data` project. For more information, see\n [Open a public dataset](/bigquery/docs/quickstarts/query-public-dataset-console#open_a_public_dataset).\n\n- Use Sharing to [view and subscribe to public\n datasets](/bigquery/docs/analytics-hub-view-subscribe-listings).\n\nTo find out when a data table was last updated, go to the table's **Details**\nsection as described in [Getting table information](/bigquery/docs/tables#getting_table_information), and\nview the **Last modified** field. For more information about selecting and\nremoving projects, see [Work with projects](/bigquery/docs/bigquery-web-ui#working_with_projects).\n\nOther public datasets\n---------------------\n\nThere are many other public datasets available for you to query, some of which\nare also hosted by Google, but many more that are hosted by third parties. Other\ndatasets include:\n\n- [NIH chest x-ray dataset](/healthcare/docs/resources/public-datasets/nih-chest)\n- [The Cancer Imaging Archive (TCIA) dataset](/healthcare/docs/resources/public-datasets/tcia)\n- [Dataset of release notes for the majority of generally available Google Cloud products.](https://console.cloud.google.com/bigquery?p=bigquery-public-data&d=google_cloud_release_notes&t=release_notes&page=table)\n\nShare a dataset with the public\n-------------------------------\n\nYou can share any of your datasets with the public by changing the dataset's\naccess controls to allow access by \"All Authenticated Users\". For more\ninformation about setting dataset access controls, see\n[Controlling access to datasets](/bigquery/docs/dataset-access-controls).\n\nWhen you share a dataset with the public:\n\n- Storage charges are incurred by the billing account attached to the project that contains the publicly-shared dataset.\n- Query charges are incurred by the billing account attached to the project where the query jobs are run.\n\nFor more information, see\n[Overview of BigQuery pricing](/bigquery/pricing#overview_of_pricing).\n\nSample tables\n-------------\n\nIn addition to the [public datasets](https://console.cloud.google.com/marketplace/browse?filter=solution-type:dataset&q=public%20data),\nBigQuery provides a limited number of sample tables that you can\nquery. These tables are contained in the\n[`bigquery-public-data:samples` dataset](https://console.cloud.google.com/bigquery?p=bigquery-public-data&d=samples&page=dataset).\n\nThe requirements for querying the BigQuery sample tables are the\nsame as the requirements for querying the public datasets.\n\nThe `bigquery-public-data:samples` dataset includes the following tables:\n\nContact us\n----------\n\nIf you have any questions about the BigQuery public dataset\nprogram, contact us at `bq-public-data@google.com`.\n\nWhat's next\n-----------\n\nLearn how to query a table in a public dataset at\n[Quickstart using the Google Cloud console](/bigquery/docs/quickstarts/quickstart-web-ui)."]]