Run a SQL query in the project and return the result. Prefer the `execute_sql_readonly`
tool if possible.
This tool can execute any query that bigquery supports including:
* SQL Queries (SELECT, INSERT, UPDATE, DELETE, CREATE, etc.)
* AI/ML functions like AI.FORECAST, ML.EVALUATE, ML.PREDICT
* Any other query that bigquery supports.
Example Queries:
-- Insert data into a table.
INSERT INTO `my_project.my_dataset`.my_table (name, age)
VALUES ('Alice', 30);
-- Create a table.
CREATE TABLE `my_project.my_dataset`.my_table (
name STRING,
age INT64);
-- DELETE data from a table.
DELETE FROM `my_project.my_dataset`.my_table WHERE name = 'Alice';
-- Create Dataset
CREATE SCHEMA `my_project.my_dataset` OPTIONS (location = 'US');
-- Drop table
DROP TABLE `my_project.my_dataset`.my_table;
-- Drop dataset
DROP SCHEMA `my_project.my_dataset`;
-- Create Model
CREATE OR REPLACE MODEL `my_project.my_dataset.my_model`
OPTIONS (
model_type = 'LINEAR_REG'
LS_INIT_LEARN_RATE=0.15,
L1_REG=1,
MAX_ITERATIONS=5,
DATA_SPLIT_METHOD='SEQ',
DATA_SPLIT_EVAL_FRACTION=0.3,
DATA_SPLIT_COL='timestamp') AS
SELECT col1, col2, timestamp, label FROM `my_project.my_dataset.my_table`;
Queries executed using the `execute_sql` tool will have the job label
`goog-mcp-server: true` automatically set. Queries are charged to the project specified
in the `project_id` field.