Courseiva

PCDE Practice Question: Manage a solution that can span multiple database technologies

A Cloud Spanner database has a table 'Orders' with a column 'status'. The development team needs to add a new column 'priority INT64' to the table without downtime. Which statement should the database administrator execute?

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

ALTER TABLE Orders ADD COLUMN priority INT64;

Spanner supports online schema changes that are non-blocking. ALTER TABLE ... ADD COLUMN is the correct DDL statement and executes without locking the table.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • CREATE INDEX idx_priority ON Orders (priority);

    Why it's wrong here

    This creates an index, not a column.

  • UPDATE Orders SET priority = 0; (no prior column)

    Why it's wrong here

    Cannot update a column that doesn't exist.

  • ALTER TABLE Orders ADD priority INT64 NOT NULL DEFAULT 0;

    Why it's wrong here

    Adding a NOT NULL column without a default value is not allowed. A default must be specified if NOT NULL is used, but the question only asks to add a column without downtime; the given statement is incomplete.

  • ALTER TABLE Orders ADD COLUMN priority INT64;

    Why this is correct

    Correct. This DDL statement adds the column online, non-blocking.

About these practice questions

Courseiva writes every PCDE question from scratch — 1,446 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This PCDE 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 PCDE exam.