GCP PlayCloud Labs
-
GCP PlayCloud Labs
-
Guided Lab: Creating a Cloud Storage Bucket
-
Guided Lab: How to Launch a GCP Compute Engine Linux Instance
-
Guided Lab: Creating a Cloud SQL Instance
-
Guided Lab: Creating a Cloud NAT Gateway
-
Guided Lab: Running SQL Commands in Cloud SQL Studio
-
Guided Lab: Hosting a Static Website in Google Cloud Storage Bucket
-
Guided Lab: Creating and Restoring Cloud SQL Backups
-
Guided Lab: Vertically Scaling a VM Instance
-
Guided Lab: Creating a Custom Image from a VM Instance with Web Server in Google Cloud
-
Guided Lab: Setting up a Web Server on a VM Instance
-
Guided Lab: Creating a Spot VM Instance
-
Guided Lab: Exploring Instance Metadata in Google Cloud
-
Guided Lab: Setting Up and Managing a Database on a VM Instance
-
Guided Lab: Integrating Cloud SQL Database instance with a VM instance
-
Guided Lab: Connecting Cloud SQL Database with MySQL Workbench (Local)
-
Guided Lab: Creating a VM Using Instance Templates
-
Guided Lab: Installing WordPress on an Ubuntu VM Instance with LEMP Stack
-
Guided Lab: Reserving or Promoting a Static IP Address for a VM Instance
-
Guided Lab: Creating a Google Kubernetes Engine (GKE) Cluster
-
Guided Lab: Protecting Data on Cloud Storage Bucket Against Accidental Delete and Overwrite Using Object Versioning
-
Guided Lab: Connecting to a Kubernetes Engine Cluster
-
Guided Lab: Creating and Managing Instance Groups in Compute Engine
-
Guided Lab: Configuring Shielded VM Options
-
Guided Lab: SSH Access to GCP VM Instance from Local Machine using SSH Key Pair
-
Guided Lab: Deploying a Simple Web Application on GKE
-
Guided Lab: Configuring Firewall Rules to Secure and Access a VM
-
Guided Lab: Establishing VPC Peering for Secure Cross‑Network Communication
-
Guided Lab: Creating a Custom Virtual Private Cloud (VPC)
-
Guided Lab: Using Startup Scripts in GCP VM Instances
-
Guided Lab: Deploying a LAMP Stack on a Compute Engine VM
-
Guided Lab: Managing Cloud Storage Buckets via SSH Commands
-
Guided Lab: Guarding Your VM with Deletion Protection
-
Guided Lab: Using Cloud Storage Lifecycle Rules to Automate Object Management
-
Guided Lab: Guarding Your Cloud SQL Instances with Deletion Protection
-
Guided Lab: Exploring Google Cloud Storage Classes
-
Guided Lab: Setting Up a Linux Bastion Host on GCP
-
Guided Lab: Uploading, Organizing, and Managing Objects in Cloud Storage
-
Guided Lab: Creating an Application Load Balancer
-
Guided Lab: Creating a Network Load Balancer
-
Guided Lab: Creating VM Snapshots and Restoring a VM from a Snapshot
Guided Lab: Running SQL Commands in Cloud SQL Studio
Description
Cloud SQL Studio provides authorized users with a direct way to interact with SQL databases from the Google Cloud Console. It allows you to run SQL queries to access and manage data without needing external tools. The interface supports common operations you would normally perform in a SQL command‑line client, such as creating and modifying tables, building indexes, or defining views.
The Studio features an integrated Explorer pane, a query editor, and a results table, giving you a complete environment for database management. From this single interface, you can execute DDL, DML, and DQL statements. For instance, rather than setting up a third‑party query tool, you can simply use the built‑in editor to create tables and query your data directly within Cloud SQL Studio.
In this guided lab, you’ll learn how to create a MySQL instance, set up users and databases, and run SQL commands directly in Cloud SQL Studio.
Prerequisites
This lab assumes you have basic knowledge of creating a CloudSQL Instance.
If you find any gaps in your knowledge, consider taking this lab:
Objectives
In this lab, you will:
- Create a MySQL instance in Cloud SQL.
- Add a user account with custom credentials to access the Cloud SQL Studio.
- Create a new database.
- Run SQL commands in Cloud SQL Studio to create tables, insert data, and query results.
Lab Steps
Create a MySQL Instance
1. On the Create a MySQL instance page, set the Edition preset to Sandbox.
2. Enter your desired Instance ID.
3. Set a desired password for the root user.

4. Leave other configurations at their default values.
5. Click Create instance to start creating the instance.
Add a User Account
1. Once the instance is created, go to the Users tab.

2. Click Add user account.
3. Enter the desired User name and Password.

3. Click Add. A confirmation message will appear in the bottom‑left corner

Create a Database
1. Navigate to the Databases tab.

2. Click Create database.
3. Enter a Database name (e.g., EmployeesDB).

4. Once done, click Create Database.
Run SQL Commands in Cloud SQL Studio
1. Navigate to the Cloud SQL Studio tab.
2. Select the database you created (EmployeesDB).
3. Enter the credentials for the user account you added earlier.

4. Click Authenticate.
4. Once authenticated, open the Untitled query editor.

5. Once authenticated, you’ll be ready to run SQL commands in Cloud SQL Studio. Begin by creating a new table within the EmployeesDB database to store employee records.
Paste the following SQL command into the query editor:
CREATE TABLE Employees ( ID INT PRIMARY KEY, Name VARCHAR(50), Age INT, Salary DECIMAL(10, 2) );
Click the Run button to execute the SQL command.

This creates a table named Employees with four columns: ID, Name, Age, and Salary

6. Insert Data into the Table
INSERT INTO Employees (ID, Name, Age, Salary)
VALUES (1, 'Jose Rizal', 25, 50000.00);
INSERT INTO Employees (ID, Name, Age, Salary)
VALUES (2, 'Andres Bonifacio', 25, 50000.00);
INSERT INTO Employees (ID, Name, Age, Salary)
VALUES (3, 'Emilio Aguinaldo', 25, 50000.00);
Click the Run button to execute the SQL commands.

These statements insert three employee records into the Employees table.
9. Query the Table
Run the following SQL command:
SELECT * FROM Employees;
Click the Run button to execute the SQL command.

This retrieves all rows and columns from the Employees table, displaying the data you inserted.
Congratulations! You have successfully created a MySQL instance, added a user account, built a database, and executed SQL commands in Cloud SQL Studio to create, populate, and query a table. You now have the foundational skills to manage Cloud SQL databases directly from the Google Cloud Console.