BigQuery - Create Table



To start leveraging the power of BigQuery, it's necessary to create a table. In this chapter, we will demonstrate how you can create a table in BigQuery.

Requirements for Creating a BigQuery Table

The requirements for creating a BigQuery table are −

  • Table source ("create table from")
  • Project
  • Dataset
  • Table name
  • Table type

Example: Creating a BigQuery Table

Returning to the Austin Bikeshare data set, we can run this CREATE TABLE statement.

Creating a BigQuery Table

This statement created a new table called bikeshare_2022_store_data. Next, let's run a query to extract some data from this newly created table −

Creating a BigQuery Table

Additionally, tables can be partitioned and clustered, which are both storage methods that can help increase the efficiency of table storage and querying.

Finally, tables generate and contain helpful metadata to let developers know when their contents were last altered (the last modified field), offer a brief description of the table's purpose or even dictate how long until table data expires (partition expiration days).

Advertisements