PDE Maintaining and Automating Data Workloads Practice Question
A BigQuery table has a REQUIRED column 'user_id' that now needs to accept NULL values due to upstream data changes. You want to alter the schema with minimal downtime and no data loss. What should you do?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Run `ALTER TABLE dataset.table ALTER COLUMN user_id DROP NOT NULL;`
BigQuery allows changing a column from REQUIRED to NULLABLE using the ALTER TABLE ALTER COLUMN SET DATA TYPE statement. This operation is a metadata change and does not require table recreation or data copy. Dropping and recreating the table would cause downtime and data loss. Using a view is a workaround but doesn't change the underlying schema. Exporting and reloading is disruptive.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Run `ALTER TABLE dataset.table ALTER COLUMN user_id DROP NOT NULL;`
Why this is correct
This BigQuery DDL statement changes the column to nullable without downtime or data loss.
- ✗
Use the bq command: `bq update --set_nullable_fields user_id dataset.table`
Why it's wrong here
This command is not valid; the correct approach is ALTER TABLE.
- ✗
Create a view that casts user_id to NULLABLE and use the view instead.
Why it's wrong here
A view does not modify the underlying table schema; the base table still has the constraint.
- ✗
Drop the table and recreate it with the column as NULLABLE.
Why it's wrong here
This would cause data loss and downtime.
Go deeper
Related to this question
About these practice questions
This PDE question is part of Courseiva's 747-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This PDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PDE exam.