Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Associate Cloud Engineer practice bank has an additional 2,014 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
A cloud engineer is managing database instances in Google Cloud and needs to query a relational, globally distributed database directly from Cloud Shell. The database is hosted on Cloud Spanner, and the engineer must run a read-only SQL query against the Orders table in the production-db database hosted on the main-instance instance without establishing an interactive connection session.
Which command should the engineer run?
gcloud sql IsThe gcloud sql command group is used to manage Cloud SQL relational database instances (supporting MySQL, PostgreSQL, and SQL Server).
gcloud sql execute-sql subcommand. gcloud sql is an administrative control-plane tool, not a direct data-plane query execution engine.mysql, psql, or sqlcmd) through gcloud sql connect, Cloud SQL Studio in the console, or database connectors.gcloud sql connect establishes an interactive client session by temporarily authorizing the caller's IP address or routing through the Cloud SQL Auth Proxy.--sql flag for inline SQL statement execution from the administrative CLI.Google Cloud CLI provided an administrative query execution command for Cloud SQL instances, but even then, it would not apply to Cloud Spanner resources.
cbt CLI IsThe cbt command-line utility is a specialized tool used to read, inspect, and perform operational tasks on Cloud Bigtable, Google Cloud's NoSQL wide-column key-value storage engine.
cbt lookup: The cbt lookup command reads data from a single specific row key (e.g., cbt lookup ). It cannot parse or execute declarative SQL SELECT statements.cbt tool cannot communicate with Cloud Spanner instances.cbt lookup and cbt read..cbtrc files or explicit -project and -instance flags for targeting Bigtable clusters.The engineer needed to retrieve a single row of data from a Cloud Bigtable NoSQL table by providing a specific row key.
gcloud spanner databases execute-sql Command IsThe gcloud spanner databases execute-sql command is the dedicated Google Cloud CLI tool used to execute standard SQL statements directly against a specific Cloud Spanner database from a terminal environment.
gcloud spanner command group.--sql flag allows developers and administrators to run queries directly from automated scripts or single-line Cloud Shell commands without opening an interactive database client.production-db) and identifies the hosting Spanner instance via the required --instance=main-instance flag.--query-mode=PROFILE flag) to inspect query execution plans and performance metrics.json, yaml, or tabular text for downstream processing.Using native gcloud subcommands avoids the overhead of provisioning database client binaries or configuring network tunneling proxies, making it the fastest and most secure method to inspect and query Spanner data.
bq query Command IsThe bq CLI is the specialized standalone command-line client designed exclusively for interacting with BigQuery, Google Cloud's enterprise analytical data warehouse.
bq queries datasets and tables located within BigQuery, not transactional tables in Cloud Spanner.bq query command does not recognize an --instance flag because BigQuery is fully serverless and organizes data into projects, datasets, and tables rather than database instances.EXTERNAL_QUERY, the command structure shown here attempts direct native querying of a Spanner instance, which fails.project_id:dataset_id.table_id syntax.--use_legacy_sql=false) and legacy SQL syntax specifically for BigQuery tables and views.The workload was running analytical queries against tables stored inside a BigQuery dataset rather than an operational Cloud Spanner database.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated