Adding BigQuery data through cloud shell

  • date 29th May, 2021 |
  • by Prwatech |
  • 0 Comments

Prerequisites

GCP account

Open Cloud shell.

Paste the Below Code in Console.

bq load \

--source_format=CSV \

--autodetect \

--noreplace \

nyc_taxi.2018_trips \

gs://cloud-training/OCBL013/nyc_tlc_yellow_trips_2018_subset_1.csv

It will add the file into the Bigquery.

Open the Table and check the details.

Paste the below code.

CREATE TABLE

     nyc_taxi.january_trips AS

SELECT

     *

FROM

     nyc_taxi.2018_trips

WHERE

     EXTRACT(Month

     FROM

          pickup_datetime)=1;

Click Run.

 It will create a new table named January_trips.

It will create a new table named January_trips.

Quick Support

image image