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.