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 an instance and database
/ 5
Create a schema for the database
/ 5
Create an instance and database
/ 5
Create a schema for the database
/ 5
Cloud Spanner is a fully managed, mission-critical, relational database service. It offers transactional consistency at global scale, schemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication for high availability.
Cloud Spanner offers the following features:
ALTER statements for schema changes.Cloud Spanner offers regional and multi-region instance configurations.
Cloud Spanner is ideal for relational, structured, and semi-structured data that requires high availability, strong consistency, and transactional reads and writes.
Consider an alternative to Cloud Spanner in the following common scenarios:
In this lab, you learn how to perform the following tasks:
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 right is the Lab setup and access panel with the following:
Note that the lab timer is located near the top of the page, showing the remaining time.
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 setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab setup and access panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
When you first use Cloud Spanner, you must create an instance, which is an allocation of resources that Cloud Spanner databases use in that instance.
In the Google Cloud console, on the Navigation menu (), click View all products, and then under Databases, click Spanner.
Click Create a provisioned instance.
Select Enterprise, and then click Continue.
For Instance name, enter Test Instance
Leave Instance ID as its default value, and then click Continue.
On the Choose a configuration page, select Regional.
For Select a configuration, select the
Do not select a different region for the instance. The
Click Continue.
Leave the Configure compute capacity settings as their defaults, and then click Create.
Your instance now appears on the Instance details page.
region violates constraint constraints/gcp.resourceLocations on the resource projects/qwiklabs-gcp-XX-XXXXXXXXX, return to the Choose a configuration section. Verify that you selected the specified lab region in step 7, and then proceed to create the instance.On the Instance overview page, click Create database.
For Database name, enter example-db, and then click Create.
The Database overview page opens for the new database you created.
Click Check my progress to verify the objective.
The Google Cloud console provides two ways to create, alter, and delete tables and indexes in a database:
This lab uses DDL.
Click Create table.
In the Untitled query field, replace the existing query with the following DDL statement:
Click Check my progress to verify the objective.
The Google Cloud console provides an interface for inserting, editing, and deleting data.
On the Database overview page, click Singers.
In the navigation pane, click Data, and then click Insert.
Replace the placeholder values for the following fields:
| Field | Value |
|---|---|
| SingerID: INT64 | 1 |
| FirstName: STRING | 'Marc' |
| LastName: STRING | 'Richards' |
| SingerInfo: BYTES | NULL |
| BirthDate: DATE | NULL |
Your query should look similar to the following:
SingerID with the given value in the Where condition comment.Click Run.
On the Database overview page, click Singers > Data to verify that the Singers table now has one row.
Click Insert to add an additional row, and replace the placeholder values with the following:
| Field | Value |
|---|---|
| SingerID: INT64 | 2 |
| FirstName: STRING | 'Catalina' |
| LastName: STRING | 'Smith' |
| SingerInfo: BYTES | NULL |
| BirthDate: DATE | NULL |
Click Run.
On the Database overview page, click Singers > Data to verify that the Singers table now has two rows.
You can also insert empty string values when you enter data.
Click Insert.
Replace the placeholder values with the following:
| Field | Value |
|---|---|
| SingerID: INT64 | 3 |
| FirstName: STRING | 'Kena' |
| LastName: STRING | ' ' |
| SingerInfo: BYTES | NULL |
| BirthDate: DATE | NULL |
Click Run.
On the Database overview page, click Singers > Data to verify that the Singers table now has three rows, and that the row for SingerId 3 has an empty string for LastName.
In this section, you continue working with the Singers table.
Select the checkbox next to the row for SingerId 3.
Click Edit.
Update the placeholder values with the following:
| Field | Value |
|---|---|
| BirthDate: DATE | '1961-04-01' |
| SingerInfo: BYTES | NULL |
[all other fields] |
[leave as-is] |
Your query should look similar to the following:
Click Run.
On the Database overview page, click Singers > Data.
The row for SingerId 3 in the Singers table now has a BirthDate value.
Now delete a row of data from the table.
Select the checkbox next to the row for SingerId 2.
Click Delete.
You can safely ignore the warning that appears in the dialog.
The Singers table now has two rows.
You can execute a SQL statement on the query page of your database.
In the navigation pane, click Spanner Studio.
Click Clear to clear the query you used for your table.
In the query editor, enter the following query:
The Google Cloud console displays the result of your query.
Test your knowledge about Cloud Spanner by answering the following question.
You've successfully created a Cloud Spanner database and executed a SQL statement using the query editor!
This lab is part of a series of labs called Qwik Starts. These labs are designed to give you a brief introduction to the many features available with Google Cloud. Review the list of "Qwik Starts" in the Google Cloud Skills Boost catalog to find the next lab you want to take!
...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 November 11, 2026
Lab Last Tested September 24, 2025
Copyright 2026 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 can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one