Google Cloud Associate Cloud Engineer · Free practice question 7 of 12
bq load CSV into a table
An analyst at Thistle Grocers must load the file gs://thistle-exports/sales.csv, which has a header row, into the BigQuery table retail.sales_raw with schema auto-detection. Which command should she run?
- A.bq cp gs://thistle-exports/sales.csv retail.sales_raw
- B.bq query --destination_table=retail.sales_raw gs://thistle-exports/sales.csv
- C.bq extract retail.sales_raw gs://thistle-exports/sales.csv
- D.bq load --source_format=CSV --skip_leading_rows=1 --autodetect retail.sales_raw gs://thistle-exports/sales.csv
Show answer and explanation
Correct answer: D. bq load --source_format=CSV --skip_leading_rows=1 --autodetect retail.sales_raw gs://thistle-exports/sales.csv
Why: bq load imports data from Cloud Storage into a table, and the flags set the CSV format, skip the header row and infer the schema. bq query runs SQL rather than loading files, bq cp copies tables, and bq extract exports a table to Cloud Storage, the opposite direction.
More free Google Cloud Associate Cloud Engineer questions
- Coldline minimum storage duration charge
- Cloud Run jobs for run-to-completion tasks
- Auto mode VPC creates regional subnets
- App Engine traffic splitting between versions
- gcloud config list active settings
- Globally unique Cloud Storage bucket names
- kubectl rollout undo for bad releases
- Browser role for hierarchy visibility
- Log Analytics SQL queries on logs
- Cloud SQL Auth Proxy benefits
- Secret Manager for application credentials