02 April 2019 · npac ·       Add to Favorites   Report

CREATE TABLE Statement syntax in BigQuery

Use the create table statement to create a new permanent table. The table name must be unique per dataset. The table name can:

  • Contain up to 1,024 characters
  • Contain letters (upper or lower case), numbers, and underscores
  • And is case sensitive
CREATE TABLE mydataset.newtable
transaction_id INT64,
transaction_date DATE,
City string,
Branch Int64,
Customer_Name string,
Amount INT64
PARTITION BY transaction_date
CLUSTER BY City, Branch

You can have only one column in the partition by clause, and it has to be a date or timestamp field. You can have up to four columns in the CLUSTER BY Field. 


posted on 02 April 2019

Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too