Basics
Database Management
Dates and Times
How to Create a Table in BigQuery
BigQuery is Google Cloud’s powerful data warehouse for large-scale data analytics. In this tutorial, you will learn how to create a table in BigQuery using three methods: the Google Cloud Console, SQL, and the command-line interface (CLI).
1. Create a Table Using the Cloud Console
- Go to the BigQuery Console.
- In the Explorer panel, select your project and dataset, then click Create Table.
- Choose the Source (e.g., Empty table, Upload, Google Cloud Storage, etc.).
- Enter a Table name and define the Schema (manually or auto-detect).
- Set any additional options (Partitioning, Clustering, Encryption).
- Click Create Table.
2. Create a Table Using SQL
CREATE TABLE dataset_name.table_name (
column1 STRING,
column2 INT64,
column3 TIMESTAMP
);Run this SQL command in the BigQuery Editor or through the API to create a table with defined columns.
3. Create a Table Using the CLI
bq mk --table project_id:dataset_name.table_name column1:STRING,column2:INT64,column3:TIMESTAMPUse the bq command-line tool to quickly create tables from your terminal or scripts.
Final Tips
- Always double-check your dataset and table names.
- Use partitioning and clustering to improve query performance on large datasets.
- Test your schema with a small dataset before production.
For more details, see the BigQuery Table Documentation.
Turn this BigQuery query into a scheduled report
DataReportive runs your SQL queries on a schedule and delivers the results via email, PDF, Excel, or HTML. Set up your reports once and get fresh data delivered automatically.
Automate BigQuery reporting with DataReportive
Turn your BigQuery queries into scheduled reports delivered to your team or customers.