The bq command line tool, part of the Google Cloud SDK and available directly inside Cloud Shell, lets you create datasets, load data, and run queries against BigQuery without touching the console UI. This walks through creating a dataset, loading a CSV file into it, and querying the result.
In Cloud Shell, use the bq mk command to create a dataset. We will call ours bq_load_codelab:
bq mk bq_load_codelab

Confirm the dataset was created by checking its properties with bq show:
bq show bq_load_codelab

Create an empty CSV file directly in Cloud Shell:
touch customer_transactions.csv
Open it in the Cloud Shell editor:
nano customer_transactions.csv

Paste in the following rows:
ID,Zipcode,Timestamp,Amount,Feedback,SKU
c123,78757,2018-02-14 17:01:39Z,1.20,4.7,he4rt5
c456,10012,2018-03-14 15:09:26Z,53.60,3.1,ppiieee
c123,78741,2018-04-01 05:59:47Z,5.98,2.0,ch0c0

To exit from editor press ctrl + x then press y following enter.
Use bq load to load the file into a new table inside your dataset:
bq load \
–source_format=CSV \
–skip_leading_rows=1 \
bq_load_codelab.customer_transactions \
./customer_transactions.csv \
id:string,zip:string,ttime:timestamp,amount:numeric,fdbk:float,sku:string
The skip leading rows flag tells BigQuery the first row is a header, not data. The final argument defines the schema directly, naming each column and its type, in the same order the CSV columns appear.

bq show bq_load_codelab.customer_transactions

Run a query joining your new table against a public BigQuery dataset of US zip codes:
bq query –nouse_legacy_sql ‘
SELECT SUM(c.amount) AS amount_total, z.state_code AS state_code
FROM `bq_load_codelab.customer_transactions` c
JOIN `bigquery-public-data.utility_us.zipcode_area` z
ON c.zip = z.zipcode
GROUP BY state_code’

Remove the dataset and everything in it once you are done:
bq rm -r bq_load_codelab

The –nouse_legacy_sql flag above tells bq query to use GoogleSQL, BigQuery’s standard SQL dialect, rather than the older legacy SQL dialect. Standard SQL has been the default for new queries for some time regardless, and Google has been restricting legacy SQL availability since June of 2026 based on usage it observed during an evaluation period. In practice, this means the flag is worth keeping in your commands for clarity, but relying on legacy SQL itself for anything new is no longer a safe long term choice.
That covers creating a dataset, loading a CSV file, and querying it using the bq command line tool. To go further, explore Prwatech’s Google Cloud training program, which includes placement assistance.