
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Create Instance
/ 20
Create Database
/ 20
Create and Load Tables
/ 20
Load Customer table
/ 20
Add Column
/ 20
In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.
When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.
To score 100% you must successfully complete all tasks within the time period!
This lab is recommended for students who have enrolled in the Create and Manage Cloud Spanner Instances skill badge. Are you ready for the challenge?
The content of this challenge lab will be most applicable to Cloud Spanner DBAs. This lab is designed to test the abilities of students who have completed the Create and Manage Cloud Spanner Databases quest.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud
is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud
, in Google Cloud, refer to the gcloud CLI overview guide.
In your role as the corporate Database Administrator, you have been tasked with standing up a new Cloud Spanner database for your company's Banking Operations group. You have been provided a list specifcations for this database related to tables datasets to load.
Your first task is to create an instance.
You may complete this step using the Cloud Console or the gcloud CLI.
Your instance must have following attributes:
Item | Value |
---|---|
Name | banking-ops-instance |
Region | |
Allocate Compute Capacity | Unit - Nodes // Quantity - 1 |
An example gcloud CLI command to create an instance is as follows:
Your next task is to create a database.
You may complete this step using the Cloud Console or the gcloud CLI.
Your database must have following attribute:
Item | Value |
---|---|
Name | banking-ops-db |
An example gcloud CLI command to create a database is as follows:
Your database must have a total of four (4) tables - Portfolio, Category, Product, and Customer.
The tables must be defined as listed below.
An example DDL command to create a table is as follows:
Table: Portfolio
Primary Key: PortfolioId
Column | Datatype |
---|---|
PortfolioId | INT64 NOT NULL |
Name | STRING(MAX) |
ShortName | STRING(MAX) |
PortfolioInfo | STRING(MAX) |
Table: Category
Primary Key: CategoryId
Column | Datatype |
---|---|
CategoryId | INT64 NOT NULL |
PortfolioId | INT64 NOT NULL |
CategoryName | STRING(MAX) |
PortfolioInfo | STRING(MAX) |
Table: Product
Primary Key: ProductId
Column | Datatype |
---|---|
ProductId | INT64 NOT NULL |
CategoryId | INT64 NOT NULL |
PortfolioId | INT64 NOT NULL |
ProductName | STRING(MAX) |
ProductAssetCode | STRING(25) |
ProductClass | STRING(25) |
Table: Customer
Primary Key: CustomerId
Column | Datatype |
---|---|
CustomerId | STRING(36) NOT NULL |
Name | STRING(MAX) NOT NULL |
Location | STRING(MAX) NOT NULL |
Three of your tables, Portfolio, Category, and Product, will be loaded with simple, low-volume datasets.
You may employ any method to load these tables.
An example DML command to load a single row into a table is as follows:
Table: Portfolio
Table: Category
Table: Product
You will load the Customer table with a much larger set of data.
A file named Customer_List_500.csv contains 500 rows of data and is located in the following public Cloud Storage bucket. You may reference or download it as necessary.
gsutil URI
HTTP URL
You may recall from the lab Cloud Spanner - Loading Data and Performing Backups that a few options exist to load larger datasets. These include using Dataflow or a client library in Batch mode. You may choose to create simple insert statements. The decision is yours but you must load all 500 rows.
Utilize any method that you prefer to load the 500 row datafile. Some methods will require edits to the datafile which will require downloading it to your local machine. Please be sure to make a backup file if you choose that option.
Note: if you use Dataflow should ensure that you specify the
Note:
As part of your DBA responsibilities you are required to add a new column called MarketingBudget to the Category table.
The column MarketingBudget must have a datatype of INT64.
Adding a new column is accomplished by a DDL command. You may issue the DDL via a gcloud command, the Cloud Console, or client library call.
An example gcloud CLI command to add a column to a table is as follows:
In this lab, you created a Cloud Spanner instance and database, created tables, loaded data, and performed DDL operations on a table.
This challenge lab is part of the Create and Manage Cloud Spanner Instances skill badge. Completing this skill badge course earns you the badge above, to recognize your achievement. Share your badge on your resume and social platforms, and announce your accomplishment using #GoogleCloudBadge.
This skill badge course is part of Google Cloud’s Database Engineer learning path. If you have already completed the other skill badge courses in this learning path, search the catalog for other skill badge courses in which you can enroll.
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated July 17, 2024
Lab Last Tested July 17, 2024
Copyright 2025 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one