Page History
The following SHOW commands can be used to describe BigQuery schema information.
Anchor | ||||
---|---|---|---|---|
|
Table of Contents |
---|
SHOW PROJECTS
SHOW PROJECTS
This command lists all the projects that you have direct access to.
Example
Code Block |
---|
SHOW PROJECTS |
SHOW DATASETS
SHOW DATASETS
SHOW DATASETS [project_ID]
SHOW DATASETS [project_ID1,project_ID2,project_ID3,...]
SHOW DATASETS [project_ID,...] INCLUDE_PUBLICDATA
This command lists all the datasets from the specified project.
If project_ID is not specified, it will list all the datasets in the current project.
If multiple projects are specified, the first project (project_ID1) must be a project that you have direct access to and the additional projects (project_ID2, project_ID3, etc.) can be projects that you have direct access to or projects with datasets that you have access to.
The INCLUDE_PUBLICDATA option lists all the datasets in the publicdata project.
Examples
Code Block |
---|
SHOW DATASETS GO SHOW DATASETS [sample-project-12345] GO SHOW DATASETS [sample-project-12345,shared-project] GO SHOW DATASETS [sample-project-12345,shared-project] INCLUDE_PUBLICDATA GO |
SHOW TABLES
SHOW TABLES
SHOW TABLES [project_ID]
SHOW TABLES [project_ID:dataset_ID]
SHOW TABLES [project_ID:dataset_ID.table]
This command lists all the tables in the specified dataset.
If project_ID is not specified, it will list all the tables in the current project.
To retrieve the properties of a table, specify project ID, dataset ID, and table.
Examples
Code Block |
---|
SHOW TABLES GO SHOW TABLES [sample-project-12345] GO SHOW TABLES [sample-project-12345:dataset1] GO SHOW TABLES [sample-project-12345:dataset1.github_timeline] GO SHOW TABLES [dataset1.github_timeline] GO |
SHOW VIEWS
SHOW VIEWS
SHOW VIEWS [project_ID]
SHOW VIEWS [project_ID:dataset_ID]
SHOW VIEWS [project_ID:dataset_ID.view]
This command lists all the views in the specified dataset.
If project_ID is not specified, it will list all the views in the current project.
To retrieve the properties of a view, specify project ID, dataset ID, and view.
Examples
Code Block |
---|
SHOW VIEWS GO SHOW VIEWS [sample-project-12345] GO SHOW VIEWS [sample-project-12345:dataset1] GO SHOW VIEWS [sample-project-12345:dataset1.github_timeline_view] GO SHOW VIEWS [dataset1.github_timeline_view] GO |
SHOW FIELDS
SHOW FIELDS [project_ID:dataset_ID.table]
SHOW FIELDS [dataset_ID.table]
SHOW FIELDS [project_ID:dataset_ID.view]
SHOW FIELDS [dataset_ID.view]
This command lists all the fields in the specified table or view.
If project_ID is not specified, it will default to the current project.
Examples
Code Block |
---|
SHOW FIELDS [dataset1.github_timeline] GO SHOW FIELDS [sample-project-12345:dataset1.github_timeline] GO |
Quote Identifiers
- You must surround the entire name reference with brackets. For example, [my-project-123:dataset1.tableName].
- If the dataset, table, or view name starts with a number or is a SQL keyword, use the double quote symbol ( " ) to enclose the dataset, table, or view name.