02 Apr 19 · npack · #bigquery ·   Bookmark   ×

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 Apr 19

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds