> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1), and the
> [Additional Terms for Generative AI
> Preview Products](https://cloud.google.com/trustedtester/aitos).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

> [!WARNING]
> **PostgreSQL interface note:** The examples in this topic are intended for GoogleSQL-dialect databases. This feature doesn't support PostgreSQL interface.

This tutorial describes how to set up and use QueryData in Spanner
using the Google Cloud console and integrate it with your application. Learn how to build the
[context sets](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/context-sets-overview.md.txt)
file, create a context set that uses the context set file, use [MCP Toolbox](https://github.com/googleapis/mcp-toolbox) to call the [QueryData method in the Conversational Analytics API](https://docs.cloud.google.com/gemini/data-agents/conversational-analytics-api/data-agent-authored-context-databases.md.txt) to generate SQL queries for natural language questions, and integrate it with your application.


For more information, see [QueryData overview](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/data-agent-overview.md.txt).


## Objectives

This tutorial covers the following objectives:

- Create databases and populate them with data.
- Build a context set file with the context engineering agent.
- Create a context set and upload a context set file.
- Test QueryData and generate SQL queries in Spanner Studio.
- Integrate QueryData with your application using [Gemini Data Analytics QueryData](https://mcp-toolbox.dev/integrations/cloudgda/tools/cloud-gda-query/) tool in MCP Toolbox.
- Add grounding to LLM responses using value search queries.

## Costs

In this document, you use the following billable components of Google Cloud:

- [Spanner](https://docs.cloud.google.com/spanner/pricing)
- [Gemini for Google Cloud API](https://docs.cloud.google.com/gemini/pricing)

To generate a cost estimate based on your projected usage, use the [pricing calculator](https://cloud.google.com/products/calculator).

New Google Cloud users might be eligible for a [free trial](https://docs.cloud.google.com/free).

To avoid continued billing, delete the resources you created when you finish the tasks in this document. For more information, see [Clean up](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/integrate-applications-data-agent.md.txt#clean-up).

## Before you begin

Complete the following prerequisites before creating a context set.

> [!NOTE]
> **Note:** Enable public IP for your Spanner instance.

### Enable required services

Enable the following services for your project:

- [Data Analytics API with Gemini](https://console.cloud.google.com/apis/library/geminidataanalytics.googleapis.com)
- [Gemini for Google Cloud API](https://console.cloud.google.com/apis/library/cloudaicompanion.googleapis.com)
- [Knowledge Catalog API](https://console.cloud.google.com/apis/library/dataplex.googleapis.com)

### Prepare a Spanner instance

- Make sure that a Spanner instance is available. For more information, see [Create an instance](https://docs.cloud.google.com/spanner/docs/create-manage-instances.md.txt).
- Ensure that you create a database in your instance where you will create the tables. For more information, see [Create a database on the
  Spanner instance](https://docs.cloud.google.com/spanner/docs/create-manage-databases#create-database).

### Required roles and permissions

- Add an IAM user or service account to the instance. For more information, see [Apply IAM roles](https://docs.cloud.google.com/spanner/docs/grant-permissions.md.txt).
- Grant the `roles/spanner.databaseReader`, `roles/serviceusage.serviceUsageConsumer`, and `roles/geminidataanalytics.queryDataUser` roles to the IAM user at the project level. For more information, see [Add IAM policy binding for a project](https://docs.cloud.google.com/sdk/gcloud/reference/projects/add-iam-policy-binding).
- To create, upload, and manage context sets, grant the Dataplex Catalog Editor (`roles/dataplex.catalogEditor`) or Dataplex Catalog Admin (`roles/dataplex.catalogAdmin`) role to the IAM user at the project level. For more information, see [Context sets permissions](https://docs.cloud.google.com/knowledge-catalog/docs/iam-permissions.md.txt#context-set-permissions).
- [Grant roles and permissions](https://docs.cloud.google.com/spanner/docs/grant-permissions.md.txt#project-level_permissions) to the IAM user at the project-level for the required databases.

> [!WARNING]
> **Warning:** All context sets associated with a database are viewable to all users with any read access to that database. In cases where users have narrower access to the database, such as Spanner fine-grained access control, users can potentially discover other fields and tables from the context set.

## Create the `flights` and `airports` schema and tables

In this section, you create the `flights` and `airports` database tables for this tutorial.

1. In the Google Cloud console, go to the Spanner page.


   [Go to Spanner](https://console.cloud.google.com/spanner)
2. Select an instance from the list, and then select a database.

3. In the navigation menu, click **Spanner Studio**.

4. Click **New SQL editor tab** or **New tab** to open a new tab.

5. To create the `airports` table and schema, execute the following SQL statement:

   ```sql
   CREATE TABLE IF NOT EXISTS airports (
     id INT64 PRIMARY KEY,
     iata STRING(MAX),
     name STRING(MAX),
     city STRING(MAX),
     country STRING(MAX)
   );
   ```
6. Create the `flights` table and schema:

   ```sql
   CREATE TABLE flights (
     id INT64 NOT NULL,
     airline STRING(10),
     flight_number INT64,
     departure_airport STRING(5),
     arrival_airport STRING(5),
     departure_time TIMESTAMP,
     arrival_time TIMESTAMP,
     departure_gate STRING(10),
     arrival_gate STRING(10)
   ) PRIMARY KEY (id);
   ```

## Populate the `flights` and `airports` tables

In this section, you populate the `flights` and `airports` tables using the provided SQL scripts.

1. Populate the `airports` table.

   #### See SQL script

   <br />

   ```sql
   -- Insert Data into Airports
   INSERT INTO airports (id, iata, name, city, country) VALUES
   (3249, 'BOS', 'General Edward Lawrence Logan International Airport', 'Boston', 'United States'),
   (3257, 'OGG', 'Kahului Airport', 'Kahului', 'United States'),
   (3259, 'MCI', 'Kansas City International Airport', 'Kansas City', 'United States'),
   (3263, 'PHX', 'Phoenix Sky Harbor International Airport', 'Phoenix', 'United States'),
   (3270, 'SFO', 'San Francisco International Airport', 'San Francisco', 'United States'),
   (3285, 'LAX', 'Los Angeles International Airport', 'Los Angeles', 'United States'),
   (3287, 'CLE', 'Cleveland Hopkins International Airport', 'Cleveland', 'United States'),
   (3295, 'EWR', 'Newark Liberty International Airport', 'Newark', 'United States'),
   (3296, 'BOI', 'Boise Air Terminal/Gowen Field', 'Boise', 'United States'),
   (3303, 'DAL', 'Dallas Love Field', 'Dallas', 'United States'),
   (3315, 'KOA', 'Ellison Onizuka Kona International At Keahole Airport', 'Kona', 'United States'),
   (3321, 'DCA', 'Ronald Reagan Washington National Airport', 'Washington', 'United States'),
   (3336, 'SLC', 'Salt Lake City International Airport', 'Salt Lake City', 'United States'),
   (3350, 'IAH', 'George Bush Intercontinental Houston Airport', 'Houston', 'United States'),
   (3370, 'PIT', 'Pittsburgh International Airport', 'Pittsburgh', 'United States'),
   (3376, 'MIA', 'Miami International Airport', 'Miami', 'United States'),
   (3377, 'SEA', 'Seattle Tacoma International Airport', 'Seattle', 'United States'),
   (3382, 'LGB', 'Long Beach /Daugherty Field/ Airport', 'Long Beach', 'United States'),
   (3385, 'IND', 'Indianapolis International Airport', 'Indianapolis', 'United States'),
   (3402, 'LIH', 'Lihue Airport', 'Lihue', 'United States'),
   (3421, 'SAT', 'San Antonio International Airport', 'San Antonio', 'United States'),
   (3426, 'RDU', 'Raleigh Durham International Airport', 'Raleigh-durham', 'United States'),
   (3436, 'TUS', 'Tucson International Airport', 'Tucson', 'United States'),
   (3444, 'BUR', 'Bob Hope Airport', 'Burbank', 'United States'),
   (3445, 'DTW', 'Detroit Metropolitan Wayne County Airport', 'Detroit', 'United States'),
   (3470, 'DFW', 'Dallas Fort Worth International Airport', 'Dallas-Fort Worth', 'United States'),
   (3473, 'AUS', 'Austin Bergstrom International Airport', 'Austin', 'United States'),
   (3478, 'STL', 'St Louis Lambert International Airport', 'St. Louis', 'United States'),
   (3482, 'ATL', 'Hartsfield Jackson Atlanta International Airport', 'Atlanta', 'United States'),
   (3487, 'FAT', 'Fresno Yosemite International Airport', 'Fresno', 'United States'),
   (3514, 'IAD', 'Washington Dulles International Airport', 'Washington', 'United States'),
   (3517, 'MKE', 'General Mitchell International Airport', 'Milwaukee', 'United States'),
   (3520, 'PDX', 'Portland International Airport', 'Portland', 'United States'),
   (3528, 'HNL', 'Daniel K Inouye International Airport', 'Honolulu', 'United States'),
   (3531, 'SAN', 'San Diego International Airport', 'San Diego', 'United States'),
   (3534, 'ONT', 'Ontario International Airport', 'Ontario', 'United States'),
   (3547, 'MDW', 'Chicago Midway International Airport', 'Chicago', 'United States'),
   (3551, 'DEN', 'Denver International Airport', 'Denver', 'United States'),
   (3552, 'PHL', 'Philadelphia International Airport', 'Philadelphia', 'United States'),
   (3597, 'JFK', 'John F Kennedy International Airport', 'New York', 'United States'),
   (3607, 'RNO', 'Reno Tahoe International Airport', 'Reno', 'United States'),
   (3617, 'SMF', 'Sacramento International Airport', 'Sacramento', 'United States'),
   (3619, 'COS', 'City of Colorado Springs Municipal Airport', 'Colorado Springs', 'United States'),
   (3639, 'PSP', 'Palm Springs International Airport', 'Palm Springs', 'United States'),
   (3649, 'BWI', 'Baltimore/Washington International Thurgood Marshall Airport', 'Baltimore', 'United States'),
   (3658, 'MSP', 'Minneapolis-St Paul International/Wold-Chamberlain Airport', 'Minneapolis', 'United States'),
   (3661, 'MSY', 'Louis Armstrong New Orleans International Airport', 'New Orleans', 'United States'),
   (3667, 'SNA', 'John Wayne Airport-Orange County Airport', 'Santa Ana', 'United States'),
   (3676, 'CLT', 'Charlotte Douglas International Airport', 'Charlotte', 'United States'),
   (3677, 'LAS', 'McCarran International Airport', 'Las Vegas', 'United States'),
   (3678, 'MCO', 'Orlando International Airport', 'Orlando', 'United States'),
   (3742, 'MRY', 'Monterey Peninsula Airport', 'Monterey', 'United States'),
   (3743, 'SBA', 'Santa Barbara Municipal Airport', 'Santa Barbara', 'United States'),
   (3830, 'ORD', 'Chicago O\'Hare International Airport', 'Chicago', 'United States'),
   (3875, 'RDD', 'Redding Municipal Airport', 'Redding', 'United States'),
   (3876, 'EUG', 'Mahlon Sweet Field', 'Eugene', 'United States'),
   (3878, 'MFR', 'Rogue Valley International Medford Airport', 'Medford', 'United States'),
   (3880, 'RDM', 'Roberts Field', 'Redmond-Bend', 'United States'),
   (4111, 'ACV', 'California Redwood Coast-Humboldt County Airport', 'Arcata CA', 'United States'),
   (4419, 'CEC', 'Jack Mc Namara Field Airport', 'Crescent City', 'United States'),
   (4460, 'SBP', 'San Luis County Regional Airport', 'San Luis Obispo', 'United States'),
   (4768, 'PSC', 'Tri Cities Airport', 'Pasco', 'United States'),
   (5088, 'SUN', 'Friedman Memorial Airport', 'Hailey', 'United States'),
   (5305, 'ASE', 'Aspen-Pitkin Co/Sardy Field', 'Aspen', 'United States'),
   (5362, 'MMH', 'Mammoth Yosemite Airport', 'Mammoth Lakes', 'United States');
   ```

   <br />

   <br />

2. Populate the `flights` table.

   #### See SQL script

   <br />

   ```sql
   -- Insert Data into Flights
   INSERT INTO flights (id, airline, flight_number, departure_airport, arrival_airport, departure_time, arrival_time, departure_gate, arrival_gate) VALUES
   (0, 'UA', 1532, 'SFO', 'DEN', '2025-01-01 05:50:00Z', '2025-01-01 09:23:00Z', 'E49', 'D6'),
   (1, 'UA', 1158, 'SFO', 'ORD', '2025-01-01 05:57:00Z', '2025-01-01 12:13:00Z', 'C38', 'D30'),
   (2, 'F9', 1057, 'IAH', 'SFO', '2025-01-01 05:52:00Z', '2025-01-01 08:14:00Z', 'E33', 'E43'),
   (3, 'OO', 6403, 'MFR', 'SFO', '2025-01-01 05:57:00Z', '2025-01-01 07:23:00Z', 'A6', 'E50'),
   (4, 'OO', 5628, 'RNO', 'SFO', '2025-01-01 06:19:00Z', '2025-01-01 07:37:00Z', 'A37', 'B29'),
   (5, 'CY', 922, 'SFO', 'LAX', '2025-01-01 06:38:00Z', '2025-01-01 07:49:00Z', 'D20', 'E45'),
   (6, 'AA', 338, 'LAX', 'SFO', '2025-01-01 06:44:00Z', '2025-01-01 08:03:00Z', 'E20', 'A45'),
   (7, 'UA', 1195, 'MCO', 'SFO', '2025-01-01 12:28:00Z', '2025-01-01 15:06:00Z', 'D22', 'B36'),
   (8, 'OO', 5632, 'SBA', 'SFO', '2025-01-01 06:56:00Z', '2025-01-01 08:39:00Z', 'E19', 'A49'),
   (9, 'UA', 300, 'CLE', 'SFO', '2025-01-01 07:15:00Z', '2025-01-01 09:22:00Z', 'E8', 'C28'),
   (10, 'UA', 706, 'SEA', 'SFO', '2025-01-01 07:14:00Z', '2025-01-01 09:07:00Z', 'A32', 'B26'),
   (11, 'AA', 167, 'MIA', 'SFO', '2025-01-01 07:47:00Z', '2025-01-01 10:51:00Z', 'A23', 'E4'),
   (12, 'OO', 5441, 'SFO', 'SBP', '2025-01-01 07:08:00Z', '2025-01-01 08:12:00Z', 'E21', 'D24'),
   (13, 'UA', 616, 'SFO', 'ORD', '2025-01-01 07:14:00Z', '2025-01-01 13:24:00Z', 'A11', 'D8'),
   (14, 'AA', 24, 'SFO', 'JFK', '2025-01-01 07:14:00Z', '2025-01-01 15:46:00Z', 'D4', 'C15'),
   (15, 'UA', 72, 'HNL', 'SFO', '2025-01-01 07:28:00Z', '2025-01-01 14:22:00Z', 'B33', 'D49'),
   (16, 'AS', 244, 'PDX', 'SFO', '2025-01-01 07:24:00Z', '2025-01-01 09:04:00Z', 'E46', 'B8'),
   (17, 'OO', 6307, 'MSP', 'SFO', '2025-01-01 07:29:00Z', '2025-01-01 09:32:00Z', 'C49', 'C36'),
   (18, 'OO', 4975, 'STL', 'SFO', '2025-01-01 07:31:00Z', '2025-01-01 09:58:00Z', 'C43', 'E16'),
   (19, 'AA', 23, 'DFW', 'SFO', '2025-01-01 08:41:00Z', '2025-01-01 10:34:00Z', 'E13', 'E19'),
   (20, 'B6', 434, 'SFO', 'BOS', '2025-01-01 08:00:00Z', '2025-01-01 16:23:00Z', 'D16', 'E46'),
   (21, 'F9', 657, 'DEN', 'SFO', '2025-01-01 07:58:00Z', '2025-01-01 09:13:00Z', 'E41', 'E28'),
   (22, 'OO', 6464, 'COS', 'SFO', '2025-01-01 07:56:00Z', '2025-01-01 09:45:00Z', 'D49', 'E17'),
   (23, 'UA', 1235, 'IAD', 'SFO', '2025-01-01 08:28:00Z', '2025-01-01 11:15:00Z', 'A22', 'D19'),
   (24, 'OO', 6527, 'EUG', 'SFO', '2025-01-01 07:54:00Z', '2025-01-01 09:36:00Z', 'D9', 'B26'),
   (25, 'AA', 242, 'SFO', 'ORD', '2025-01-01 08:18:00Z', '2025-01-01 14:26:00Z', 'E30', 'C1'),
   (26, 'UA', 1739, 'SFO', 'EWR', '2025-01-01 08:22:00Z', '2025-01-01 16:42:00Z', 'C13', 'D45'),
   (27, 'B6', 133, 'BOS', 'SFO', '2025-01-01 08:34:00Z', '2025-01-01 12:30:00Z', 'D49', 'C16'),
   (28, 'OO', 6336, 'SFO', 'RNO', '2025-01-01 08:32:00Z', '2025-01-01 09:29:00Z', 'B45', 'A2'),
   (29, 'UA', 567, 'IAD', 'SFO', '2025-01-01 10:47:00Z', '2025-01-01 13:39:00Z', 'C27', 'B24'),
   (30, 'OO', 5223, 'SLC', 'SFO', '2025-01-01 08:50:00Z', '2025-01-01 09:55:00Z', 'C38', 'C11'),
   (31, 'US', 1784, 'SFO', 'CLT', '2025-01-01 08:47:00Z', '2025-01-01 16:32:00Z', 'C42', 'C31'),
   (32, 'WN', 1579, 'ATL', 'SFO', '2025-01-01 08:48:00Z', '2025-01-01 10:55:00Z', 'C47', 'B5'),
   (33, 'OO', 6396, 'BOI', 'SFO', '2025-01-01 08:56:00Z', '2025-01-01 09:43:00Z', 'E20', 'A6'),
   (34, 'AA', 2293, 'DFW', 'SFO', '2025-01-01 08:57:00Z', '2025-01-01 11:08:00Z', 'D41', 'C37'),
   (35, 'DL', 1106, 'SFO', 'MSP', '2025-01-01 09:06:00Z', '2025-01-01 14:56:00Z', 'E38', 'B30'),
   (36, 'DL', 1631, 'SFO', 'ATL', '2025-01-01 09:00:00Z', '2025-01-01 16:26:00Z', 'B13', 'B45'),
   (37, 'OO', 5427, 'SFO', 'SMF', '2025-01-01 09:06:00Z', '2025-01-01 10:00:00Z', 'C34', 'C25'),
   (38, 'CY', 352, 'SFO', 'BOS', '2025-01-01 09:25:00Z', '2025-01-01 17:51:00Z', 'A46', 'E42'),
   (39, 'UA', 1239, 'LAX', 'SFO', '2025-01-01 09:59:00Z', '2025-01-01 11:19:00Z', 'A35', 'C2'),
   (40, 'UA', 1285, 'SFO', 'IAH', '2025-01-01 09:41:00Z', '2025-01-01 15:20:00Z', 'A39', 'E10'),
   (41, 'CY', 753, 'SEA', 'SFO', '2025-01-01 09:58:00Z', '2025-01-01 11:53:00Z', 'C40', 'E35'),
   (42, 'CY', 956, 'SFO', 'SAN', '2025-01-01 09:57:00Z', '2025-01-01 11:30:00Z', 'B10', 'E44'),
   (43, 'OO', 5196, 'PDX', 'SFO', '2025-01-01 09:53:00Z', '2025-01-01 11:39:00Z', 'D13', 'C34'),
   (44, 'WN', 2346, 'SFO', 'LAX', '2025-01-01 09:59:00Z', '2025-01-01 11:17:00Z', 'C24', 'E45'),
   (45, 'OO', 6400, 'EUG', 'SFO', '2025-01-01 10:06:00Z', '2025-01-01 11:27:00Z', 'E46', 'D20'),
   (46, 'CY', 23, 'JFK', 'SFO', '2025-01-01 10:21:00Z', '2025-01-01 14:09:00Z', 'D2', 'B21'),
   (47, 'B6', 534, 'SFO', 'BOS', '2025-01-01 10:33:00Z', '2025-01-01 18:55:00Z', 'A49', 'A5'),
   (48, 'UA', 1727, 'BOS', 'SFO', '2025-01-01 10:34:00Z', '2025-01-01 13:57:00Z', 'D43', 'A31'),
   (49, 'WN', 4391, 'LAS', 'SFO', '2025-01-01 10:49:00Z', '2025-01-01 12:17:00Z', 'A40', 'C49'),
   (50, 'OO', 5335, 'CEC', 'SFO', '2025-01-01 10:25:00Z', '2025-01-01 12:04:00Z', 'C8', 'C6'),
   (51, 'DL', 1680, 'ATL', 'SFO', '2025-01-01 10:43:00Z', '2025-01-01 12:45:00Z', 'E49', 'E24'),
   (52, 'OO', 6283, 'SFO', 'MCI', '2025-01-01 10:38:00Z', '2025-01-01 17:01:00Z', 'C32', 'B12'),
   (53, 'OO', 5260, 'SFO', 'FAT', '2025-01-01 10:37:00Z', '2025-01-01 11:39:00Z', 'B46', 'B43'),
   (54, 'OO', 6249, 'LAS', 'SFO', '2025-01-01 10:48:00Z', '2025-01-01 12:19:00Z', 'D11', 'A49'),
   (55, 'AA', 23, 'SFO', 'DFW', '2025-01-01 11:23:00Z', '2025-01-01 17:00:00Z', 'B31', 'A11'),
   (56, 'UA', 753, 'SFO', 'AUS', '2025-01-01 10:59:00Z', '2025-01-01 16:44:00Z', 'B18', 'D6'),
   (57, 'WN', 4855, 'SFO', 'MKE', '2025-01-01 11:08:00Z', '2025-01-01 17:33:00Z', 'D3', 'D40'),
   (58, 'DL', 1845, 'SLC', 'SFO', '2025-01-01 11:29:00Z', '2025-01-01 12:06:00Z', 'A22', 'D2'),
   (59, 'UA', 720, 'SFO', 'DEN', '2025-01-01 12:46:00Z', '2025-01-01 16:19:00Z', 'C41', 'E39'),
   (60, 'UA', 1257, 'IAH', 'SFO', '2025-01-01 11:30:00Z', '2025-01-01 13:19:00Z', 'A26', 'D2'),
   (61, 'WN', 2509, 'SFO', 'LAX', '2025-01-01 11:34:00Z', '2025-01-01 13:03:00Z', 'C42', 'D35'),
   (62, 'UA', 73, 'EWR', 'SFO', '2025-01-01 12:11:00Z', '2025-01-01 15:24:00Z', 'C5', 'E10'),
   (63, 'UA', 364, 'PHX', 'SFO', '2025-01-01 11:56:00Z', '2025-01-01 13:11:00Z', 'A39', 'D26'),
   (64, 'AA', 221, 'DFW', 'SFO', '2025-01-01 11:55:00Z', '2025-01-01 13:30:00Z', 'A47', 'B22'),
   (65, 'AA', 2293, 'SFO', 'DFW', '2025-01-01 12:04:00Z', '2025-01-01 17:36:00Z', 'C43', 'E30'),
   (66, 'OO', 5199, 'SFO', 'SLC', '2025-01-01 12:09:00Z', '2025-01-01 14:58:00Z', 'A40', 'E42'),
   (67, 'OO', 6280, 'SLC', 'SFO', '2025-01-01 12:13:00Z', '2025-01-01 13:09:00Z', 'E16', 'E36'),
   (68, 'OO', 6317, 'RNO', 'SFO', '2025-01-01 12:05:00Z', '2025-01-01 13:09:00Z', 'C23', 'A31'),
   (69, 'UA', 864, 'SFO', 'EWR', '2025-01-01 12:14:00Z', '2025-01-01 20:38:00Z', 'C30', 'E37'),
   (70, 'OO', 5400, 'ONT', 'SFO', '2025-01-01 12:25:00Z', '2025-01-01 13:40:00Z', 'A48', 'E19'),
   (71, 'UA', 236, 'HNL', 'SFO', '2025-01-01 12:40:00Z', '2025-01-01 19:36:00Z', 'A34', 'C12'),
   (72, 'OO', 6343, 'SNA', 'SFO', '2025-01-01 12:37:00Z', '2025-01-01 13:57:00Z', 'A15', 'D26'),
   (73, 'UA', 1148, 'SFO', 'IAD', '2025-01-01 13:10:00Z', '2025-01-01 21:02:00Z', 'D24', 'A23'),
   (74, 'DL', 432, 'JFK', 'SFO', '2025-01-01 13:00:00Z', '2025-01-01 16:28:00Z', 'E3', 'A35'),
   (75, 'B6', 1435, 'SFO', 'LGB', '2025-01-01 13:33:00Z', '2025-01-01 14:47:00Z', 'B24', 'C12'),
   (76, 'OO', 6408, 'SFO', 'EUG', '2025-01-01 13:43:00Z', '2025-01-01 15:10:00Z', 'B47', 'A35'),
   (77, 'UA', 645, 'PDX', 'SFO', '2025-01-01 13:27:00Z', '2025-01-01 15:02:00Z', 'D7', 'E4'),
   (78, 'WN', 1812, 'SFO', 'SAN', '2025-01-01 14:32:00Z', '2025-01-01 15:51:00Z', 'B35', 'D48'),
   (79, 'OO', 6409, 'SFO', 'PDX', '2025-01-01 13:42:00Z', '2025-01-01 15:27:00Z', 'C10', 'B17'),
   (80, 'UA', 358, 'AUS', 'SFO', '2025-01-01 14:31:00Z', '2025-01-01 15:48:00Z', 'E33', 'D21'),
   (81, 'UA', 1728, 'OGG', 'SFO', '2025-01-01 14:02:00Z', '2025-01-01 20:38:00Z', 'A30', 'C29'),
   (82, 'UA', 816, 'SEA', 'SFO', '2025-01-01 13:44:00Z', '2025-01-01 15:38:00Z', 'A36', 'A9'),
   (83, 'UA', 724, 'HNL', 'SFO', '2025-01-01 13:59:00Z', '2025-01-01 20:44:00Z', 'A14', 'C9'),
   (84, 'UA', 1733, 'SFO', 'DEN', '2025-01-01 14:38:00Z', '2025-01-01 18:35:00Z', 'B27', 'E32'),
   (85, 'OO', 5543, 'SFO', 'BOI', '2025-01-01 14:27:00Z', '2025-01-01 17:10:00Z', 'E10', 'B16'),
   (86, 'UA', 1761, 'IAH', 'SFO', '2025-01-01 14:55:00Z', '2025-01-01 16:45:00Z', 'B2', 'E20'),
   (87, 'UA', 277, 'DEN', 'SFO', '2025-01-01 14:44:00Z', '2025-01-01 16:04:00Z', 'B47', 'B13'),
   (88, 'AA', 1213, 'DFW', 'SFO', '2025-01-01 15:14:00Z', '2025-01-01 16:45:00Z', 'D11', 'C31'),
   (89, 'US', 407, 'PHX', 'SFO', '2025-01-01 15:03:00Z', '2025-01-01 16:00:00Z', 'C7', 'D19'),
   (90, 'OO', 5367, 'SFO', 'RDM', '2025-01-01 14:52:00Z', '2025-01-01 16:23:00Z', 'A5', 'E40'),
   (91, 'OO', 5454, 'SMF', 'SFO', '2025-01-01 15:46:00Z', '2025-01-01 16:33:00Z', 'A20', 'A40'),
   (92, 'WN', 2687, 'SFO', 'LAX', '2025-01-01 15:15:00Z', '2025-01-01 16:35:00Z', 'D41', 'B37'),
   (93, 'CY', 932, 'SFO', 'LAX', '2025-01-01 15:31:00Z', '2025-01-01 16:51:00Z', 'A19', 'E46'),
   (94, 'WN', 3236, 'SFO', 'SAN', '2025-01-01 15:56:00Z', '2025-01-01 17:23:00Z', 'B29', 'B32'),
   (95, 'UA', 404, 'IAH', 'SFO', '2025-01-01 15:56:00Z', '2025-01-01 17:52:00Z', 'B15', 'B42'),
   (96, 'CY', 933, 'LAX', 'SFO', '2025-01-01 15:42:00Z', '2025-01-01 16:51:00Z', 'E16', 'E7'),
   (97, 'US', 596, 'SFO', 'PHX', '2025-01-01 15:51:00Z', '2025-01-01 18:52:00Z', 'B25', 'E38'),
   (98, 'AA', 379, 'SFO', 'DFW', '2025-01-01 16:04:00Z', '2025-01-01 21:55:00Z', 'A30', 'D49'),
   (99, 'OO', 6280, 'SFO', 'SNA', '2025-01-01 16:52:00Z', '2025-01-01 18:19:00Z', 'B5', 'C40'),
   (100, 'UA', 735, 'DEN', 'SFO', '2025-01-01 17:34:00Z', '2025-01-01 19:09:00Z', 'C31', 'B15'),
   (101, 'OO', 5553, 'PDX', 'SFO', '2025-01-01 16:00:00Z', '2025-01-01 17:36:00Z', 'E9', 'D27'),
   (102, 'UA', 73, 'SFO', 'HNL', '2025-01-01 16:13:00Z', '2025-01-01 19:52:00Z', 'C37', 'B37'),
   (103, 'UA', 587, 'SEA', 'SFO', '2025-01-01 16:25:00Z', '2025-01-01 18:27:00Z', 'B7', 'B23'),
   (104, 'OO', 5363, 'SFO', 'ONT', '2025-01-01 16:09:00Z', '2025-01-01 17:28:00Z', 'D21', 'E29'),
   (105, 'OO', 6386, 'SFO', 'BOI', '2025-01-01 16:12:00Z', '2025-01-01 18:58:00Z', 'D48', 'E33'),
   (106, 'CY', 27, 'JFK', 'SFO', '2025-01-01 16:28:00Z', '2025-01-01 20:19:00Z', 'C6', 'E14'),
   (107, 'OO', 5190, 'SFO', 'ASE', '2025-01-01 16:24:00Z', '2025-01-01 19:42:00Z', 'C50', 'B44'),
   (108, 'CY', 746, 'SFO', 'SEA', '2025-01-01 16:40:00Z', '2025-01-01 18:32:00Z', 'D35', 'C24'),
   (109, 'UA', 1640, 'SFO', 'ORD', '2025-01-01 17:01:00Z', '2025-01-01 23:02:00Z', 'E27', 'C24'),
   (110, 'OO', 6221, 'MCI', 'SFO', '2025-01-01 17:28:00Z', '2025-01-01 19:08:00Z', 'E2', 'C36'),
   (111, 'UA', 486, 'SFO', 'LAS', '2025-01-01 16:47:00Z', '2025-01-01 18:16:00Z', 'C42', 'B47'),
   (112, 'CY', 2, 'DCA', 'SFO', '2025-01-01 17:01:00Z', '2025-01-01 20:07:00Z', 'E43', 'A33'),
   (113, 'B6', 1436, 'LGB', 'SFO', '2025-01-01 16:59:00Z', '2025-01-01 18:35:00Z', 'B12', 'B22'),
   (114, 'WN', 694, 'PHX', 'SFO', '2025-01-01 17:11:00Z', '2025-01-01 18:05:00Z', 'B44', 'B18'),
   (115, 'OO', 5635, 'MMH', 'SFO', '2025-01-01 17:00:00Z', '2025-01-01 18:01:00Z', 'A25', 'D7'),
   (116, 'AS', 341, 'PSP', 'SFO', '2025-01-01 18:25:00Z', '2025-01-01 19:46:00Z', 'A11', 'E18'),
   (117, 'OO', 6364, 'PSP', 'SFO', '2025-01-01 18:01:00Z', '2025-01-01 19:31:00Z', 'A14', 'B47'),
   (118, 'OO', 5418, 'SBP', 'SFO', '2025-01-01 17:17:00Z', '2025-01-01 18:15:00Z', 'B24', 'D17'),
   (119, 'AA', 197, 'SFO', 'ORD', '2025-01-01 17:21:00Z', '2025-01-01 23:33:00Z', 'D25', 'E49'),
   (120, 'CY', 720, 'SFO', 'DAL', '2025-01-01 18:25:00Z', '2025-01-01 23:43:00Z', 'B24', 'A2'),
   (121, 'OO', 6268, 'FAT', 'SFO', '2025-01-01 17:33:00Z', '2025-01-01 18:39:00Z', 'E35', 'D25'),
   (122, 'OO', 5615, 'SFO', 'EUG', '2025-01-01 17:45:00Z', '2025-01-01 19:18:00Z', 'B11', 'A34'),
   (123, 'CY', 960, 'SFO', 'SAN', '2025-01-01 17:55:00Z', '2025-01-01 19:23:00Z', 'D23', 'E44'),
   (124, 'AA', 1393, 'DFW', 'SFO', '2025-01-01 17:51:00Z', '2025-01-01 19:25:00Z', 'E11', 'A41'),
   (125, 'OO', 6352, 'BOI', 'SFO', '2025-01-01 17:58:00Z', '2025-01-01 18:46:00Z', 'B31', 'D23'),
   (126, 'DL', 1151, 'SFO', 'HNL', '2025-01-01 17:53:00Z', '2025-01-01 21:34:00Z', 'E29', 'B45'),
   (127, 'OO', 5227, 'SFO', 'SAN', '2025-01-01 19:07:00Z', '2025-01-01 20:31:00Z', 'A35', 'B38'),
   (128, 'CY', 941, 'LAX', 'SFO', '2025-01-01 18:19:00Z', '2025-01-01 19:34:00Z', 'C33', 'B44'),
   (129, 'UA', 1044, 'EWR', 'SFO', '2025-01-01 19:19:00Z', '2025-01-01 22:53:00Z', 'D50', 'D26'),
   (130, 'CY', 211, 'ORD', 'SFO', '2025-01-01 18:41:00Z', '2025-01-01 21:14:00Z', 'D13', 'E45'),
   (131, 'UA', 685, 'ORD', 'SFO', '2025-01-01 18:51:00Z', '2025-01-01 21:04:00Z', 'D26', 'D45'),
   (132, 'UA', 370, 'SFO', 'SEA', '2025-01-01 18:49:00Z', '2025-01-01 20:41:00Z', 'B6', 'E20'),
   (133, 'UA', 1433, 'IAH', 'SFO', '2025-01-01 19:45:00Z', '2025-01-01 21:39:00Z', 'C42', 'C48'),
   (134, 'UA', 1172, 'DEN', 'SFO', '2025-01-01 20:19:00Z', '2025-01-01 22:37:00Z', 'E31', 'D43'),
   (135, 'CY', 593, 'PSP', 'SFO', '2025-01-01 19:09:00Z', '2025-01-01 20:26:00Z', 'C23', 'C43'),
   (136, 'UA', 1564, 'SFO', 'ORD', '2025-01-01 19:14:00Z', '2025-01-02 01:14:00Z', 'E3', 'C48'),
   (137, 'UA', 741, 'ORD', 'SFO', '2025-01-01 19:18:00Z', '2025-01-01 21:58:00Z', 'A25', 'B38'),
   (138, 'WN', 600, 'SFO', 'SNA', '2025-01-01 19:36:00Z', '2025-01-01 20:53:00Z', 'D21', 'D11'),
   (139, 'F9', 664, 'SFO', 'DEN', '2025-01-01 19:31:00Z', '2025-01-01 23:13:00Z', 'E11', 'E12'),
   (140, 'OO', 4995, 'LAS', 'SFO', '2025-01-01 19:18:00Z', '2025-01-01 20:58:00Z', 'B42', 'B49'),
   (141, 'CY', 717, 'DAL', 'SFO', '2025-01-01 19:31:00Z', '2025-01-01 21:02:00Z', 'A42', 'D32'),
   (142, 'UA', 1243, 'SFO', 'DEN', '2025-01-01 19:38:00Z', '2025-01-01 23:15:00Z', 'B34', 'A3'),
   (143, 'UA', 560, 'IAD', 'SFO', '2025-01-01 19:41:00Z', '2025-01-01 22:29:00Z', 'D9', 'D33'),
   (144, 'WN', 2791, 'LAX', 'SFO', '2025-01-01 19:45:00Z', '2025-01-01 20:57:00Z', 'C49', 'C22'),
   (145, 'WN', 2079, 'SAN', 'SFO', '2025-01-01 21:03:00Z', '2025-01-01 22:33:00Z', 'A25', 'E24'),
   (146, 'OO', 6356, 'SFO', 'SLC', '2025-01-01 19:57:00Z', '2025-01-01 22:49:00Z', 'A28', 'C45'),
   (147, 'OO', 6290, 'PSP', 'SFO', '2025-01-01 19:48:00Z', '2025-01-01 21:12:00Z', 'A33', 'E27'),
   (148, 'OO', 5363, 'ONT', 'SFO', '2025-01-01 20:27:00Z', '2025-01-01 21:54:00Z', 'A14', 'E17'),
   (149, 'OO', 5206, 'SFO', 'PHX', '2025-01-01 20:12:00Z', '2025-01-01 23:05:00Z', 'D22', 'E31'),
   (150, 'B6', 1136, 'LGB', 'SFO', '2025-01-01 20:41:00Z', '2025-01-01 21:56:00Z', 'B7', 'E45'),
   (151, 'US', 736, 'PHX', 'SFO', '2025-01-01 21:12:00Z', '2025-01-01 22:11:00Z', 'B22', 'E33'),
   (152, 'AA', 1611, 'DFW', 'SFO', '2025-01-01 21:42:00Z', '2025-01-01 23:37:00Z', 'A13', 'B44'),
   (153, 'UA', 1241, 'SFO', 'EWR', '2025-01-01 21:44:00Z', '2025-01-02 05:55:00Z', 'D3', 'A17'),
   (154, 'UA', 1726, 'OGG', 'SFO', '2025-01-01 22:19:00Z', '2025-01-02 04:56:00Z', 'C35', 'B23'),
   (155, 'US', 898, 'SFO', 'CLT', '2025-01-01 22:29:00Z', '2025-01-02 06:18:00Z', 'D7', 'D15'),
   (156, 'UA', 1669, 'SFO', 'PHL', '2025-01-01 22:26:00Z', '2025-01-02 06:30:00Z', 'B13', 'A12'),
   (157, 'UA', 362, 'SFO', 'BWI', '2025-01-01 22:31:00Z', '2025-01-02 06:36:00Z', 'E32', 'A36'),
   (158, 'OO', 6220, 'SFO', 'RNO', '2025-01-01 22:25:00Z', '2025-01-01 23:23:00Z', 'D18', 'A31'),
   (159, 'OO', 6376, 'SFO', 'MRY', '2025-01-01 22:35:00Z', '2025-01-01 23:19:00Z', 'C24', 'E48'),
   (160, 'UA', 522, 'SFO', 'PDX', '2025-01-01 22:36:00Z', '2025-01-02 00:31:00Z', 'B17', 'A40'),
   (161, 'UA', 1728, 'SFO', 'BOS', '2025-01-01 22:46:00Z', '2025-01-02 07:20:00Z', 'C40', 'E43'),
   (162, 'UA', 724, 'SFO', 'LAX', '2025-01-01 22:45:00Z', '2025-01-02 00:29:00Z', 'E43', 'B23'),
   (163, 'UA', 1681, 'SFO', 'CLE', '2025-01-01 23:03:00Z', '2025-01-02 06:45:00Z', 'D26', 'E19'),
   (164, 'UA', 1580, 'OGG', 'SFO', '2025-01-01 23:24:00Z', '2025-01-02 06:07:00Z', 'E38', 'A35'),
   (165, 'DL', 806, 'SFO', 'MSP', '2025-01-02 00:22:00Z', '2025-01-02 05:57:00Z', 'B27', 'A3'),
   (166, 'OO', 5467, 'ONT', 'SFO', '2025-01-02 05:02:00Z', '2025-01-02 06:18:00Z', 'E8', 'C32'),
   (167, 'WN', 1989, 'SFO', 'LAS', '2025-01-02 05:35:00Z', '2025-01-02 06:46:00Z', 'A21', 'D15'),
   (168, 'UA', 1619, 'BOS', 'SFO', '2025-01-02 05:56:00Z', '2025-01-02 09:56:00Z', 'C46', 'E11'),
   (169, 'UA', 1076, 'SFO', 'ORD', '2025-01-02 05:58:00Z', '2025-01-02 12:00:00Z', 'E27', 'A31'),
   (170, 'F9', 1056, 'SFO', 'IAH', '2025-01-02 05:59:00Z', '2025-01-02 12:09:00Z', 'A29', 'B13'),
   (171, 'WN', 2242, 'LAX', 'SFO', '2025-01-02 06:22:00Z', '2025-01-02 07:36:00Z', 'C12', 'D43'),
   (172, 'B6', 735, 'SFO', 'LGB', '2025-01-02 06:01:00Z', '2025-01-02 07:20:00Z', 'C2', 'C37'),
   (173, 'WN', 3859, 'SFO', 'MDW', '2025-01-02 06:27:00Z', '2025-01-02 12:26:00Z', 'A28', 'E38'),
   (174, 'UA', 1285, 'SFO', 'ORD', '2025-01-02 06:43:00Z', '2025-01-02 12:47:00Z', 'B43', 'A35'),
   (175, 'WN', 1726, 'SFO', 'PHX', '2025-01-02 06:32:00Z', '2025-01-02 09:20:00Z', 'C16', 'B2'),
   (176, 'OO', 5186, 'SFO', 'SAN', '2025-01-02 06:25:00Z', '2025-01-02 07:59:00Z', 'C47', 'C1'),
   (177, 'UA', 566, 'PIT', 'SFO', '2025-01-02 07:15:00Z', '2025-01-02 09:46:00Z', 'C39', 'E39'),
   (178, 'UA', 1195, 'MCO', 'SFO', '2025-01-02 07:18:00Z', '2025-01-02 10:05:00Z', 'A47', 'C43'),
   (179, 'CY', 925, 'LAX', 'SFO', '2025-01-02 06:57:00Z', '2025-01-02 08:07:00Z', 'E29', 'C19'),
   (180, 'UA', 761, 'ORD', 'SFO', '2025-01-02 07:07:00Z', '2025-01-02 09:34:00Z', 'B22', 'A3'),
   (181, 'UA', 758, 'SFO', 'JFK', '2025-01-02 07:07:00Z', '2025-01-02 15:53:00Z', 'B15', 'B39'),
   (182, 'CY', 67, 'IAD', 'SFO', '2025-01-02 07:07:00Z', '2025-01-02 10:00:00Z', 'D24', 'E33'),
   (183, 'UA', 706, 'SEA', 'SFO', '2025-01-02 07:05:00Z', '2025-01-02 08:59:00Z', 'D9', 'C28'),
   (184, 'OO', 5441, 'SFO', 'SBP', '2025-01-02 07:06:00Z', '2025-01-02 08:11:00Z', 'B3', 'B29'),
   (185, 'CY', 202, 'SFO', 'ORD', '2025-01-02 07:18:00Z', '2025-01-02 13:23:00Z', 'C16', 'D10'),
   (186, 'CY', 710, 'SFO', 'DAL', '2025-01-02 07:16:00Z', '2025-01-02 12:43:00Z', 'D1', 'E13'),
   (187, 'AA', 24, 'SFO', 'JFK', '2025-01-02 07:06:00Z', '2025-01-02 15:29:00Z', 'C38', 'D2'),
   (188, 'UA', 72, 'HNL', 'SFO', '2025-01-02 07:28:00Z', '2025-01-02 14:20:00Z', 'C8', 'E18'),
   (189, 'UA', 1278, 'ATL', 'SFO', '2025-01-02 07:30:00Z', '2025-01-02 09:41:00Z', 'C16', 'B21'),
   (190, 'UA', 498, 'SFO', 'SAN', '2025-01-02 07:20:00Z', '2025-01-02 08:38:00Z', 'B42', 'E44'),
   (191, 'CY', 183, 'EWR', 'SFO', '2025-01-02 07:26:00Z', '2025-01-02 10:51:00Z', 'B33', 'A12'),
   (192, 'AA', 76, 'SFO', 'LAX', '2025-01-02 07:22:00Z', '2025-01-02 08:44:00Z', 'E28', 'B18'),
   (193, 'WN', 2325, 'DEN', 'SFO', '2025-01-02 07:40:00Z', '2025-01-02 09:03:00Z', 'A5', 'A17'),
   (194, 'WN', 1545, 'LAX', 'SFO', '2025-01-02 07:48:00Z', '2025-01-02 09:02:00Z', 'D42', 'A25'),
   (195, 'OO', 5196, 'SFO', 'PDX', '2025-01-02 07:46:00Z', '2025-01-02 09:32:00Z', 'B12', 'B11'),
   (196, 'UA', 1053, 'DEN', 'SFO', '2025-01-02 08:06:00Z', '2025-01-02 09:41:00Z', 'C37', 'E7'),
   (197, 'AA', 23, 'DFW', 'SFO', '2025-01-02 07:53:00Z', '2025-01-02 09:26:00Z', 'D24', 'C34'),
   (198, 'UA', 322, 'SNA', 'SFO', '2025-01-02 07:53:00Z', '2025-01-02 09:17:00Z', 'E22', 'D32'),
   (199, 'UA', 500, 'IND', 'SFO', '2025-01-02 08:02:00Z', '2025-01-02 09:46:00Z', 'D47', 'B25'),
   (200, 'UA', 662, 'SAN', 'SFO', '2025-01-02 08:51:00Z', '2025-01-02 10:38:00Z', 'C36', 'B37'),
   (201, 'UA', 834, 'LAS', 'SFO', '2025-01-02 07:51:00Z', '2025-01-02 09:17:00Z', 'B24', 'E14'),
   (202, 'CY', 1930, 'SFO', 'LAX', '2025-01-02 07:58:00Z', '2025-01-02 09:29:00Z', 'D1', 'E49'),
   (203, 'UA', 1454, 'ORD', 'SFO', '2025-01-02 08:09:00Z', '2025-01-02 10:54:00Z', 'C45', 'D18'),
   (204, 'AA', 1368, 'SFO', 'DFW', '2025-01-02 08:11:00Z', '2025-01-02 13:35:00Z', 'A24', 'D28'),
   (205, 'UA', 460, 'LAX', 'SFO', '2025-01-02 08:22:00Z', '2025-01-02 09:53:00Z', 'E4', 'D14'),
   (206, 'UA', 1547, 'SFO', 'BOS', '2025-01-02 08:30:00Z', '2025-01-02 16:52:00Z', 'B24', 'D37'),
   (207, 'AA', 242, 'SFO', 'ORD', '2025-01-02 08:28:00Z', '2025-01-02 14:41:00Z', 'D10', 'B31'),
   (208, 'OO', 5538, 'MFR', 'SFO', '2025-01-02 08:15:00Z', '2025-01-02 09:44:00Z', 'D3', 'B43'),
   (209, 'UA', 1739, 'SFO', 'EWR', '2025-01-02 08:56:00Z', '2025-01-02 17:03:00Z', 'B18', 'A15'),
   (210, 'DL', 745, 'DTW', 'SFO', '2025-01-02 08:36:00Z', '2025-01-02 10:43:00Z', 'B2', 'D29'),
   (211, 'OO', 5445, 'SFO', 'SBP', '2025-01-02 10:35:00Z', '2025-01-02 11:50:00Z', 'D39', 'A1'),
   (212, 'OO', 5223, 'SLC', 'SFO', '2025-01-02 08:52:00Z', '2025-01-02 09:50:00Z', 'C17', 'C19'),
   (213, 'UA', 1615, 'SFO', 'IAD', '2025-01-02 08:44:00Z', '2025-01-02 16:41:00Z', 'A19', 'C46'),
   (214, 'AA', 1435, 'ORD', 'SFO', '2025-01-02 08:43:00Z', '2025-01-02 11:08:00Z', 'B49', 'B11'),
   (215, 'HA', 11, 'SFO', 'HNL', '2025-01-02 09:28:00Z', '2025-01-02 13:38:00Z', 'E28', 'B21'),
   (216, 'OO', 6373, 'SFO', 'DFW', '2025-01-02 08:51:00Z', '2025-01-02 14:40:00Z', 'B42', 'D13'),
   (217, 'UA', 479, 'SFO', 'LAX', '2025-01-02 11:15:00Z', '2025-01-02 12:47:00Z', 'E32', 'B7'),
   (218, 'UA', 361, 'SFO', 'LIH', '2025-01-02 09:33:00Z', '2025-01-02 13:10:00Z', 'A45', 'C26'),
   (219, 'WN', 2074, 'SFO', 'SNA', '2025-01-02 09:08:00Z', '2025-01-02 10:18:00Z', 'A6', 'A49'),
   (220, 'CY', 84, 'SFO', 'IAD', '2025-01-02 09:20:00Z', '2025-01-02 17:25:00Z', 'A37', 'B4'),
   (221, 'WN', 2969, 'SAN', 'SFO', '2025-01-02 09:35:00Z', '2025-01-02 10:59:00Z', 'B50', 'A43'),
   (222, 'UA', 1249, 'SFO', 'MCO', '2025-01-02 10:10:00Z', '2025-01-02 18:15:00Z', 'D13', 'E20'),
   (223, 'WN', 1820, 'SFO', 'LAS', '2025-01-02 09:52:00Z', '2025-01-02 11:19:00Z', 'B19', 'D16'),
   (224, 'WN', 2414, 'SFO', 'PHX', '2025-01-02 09:57:00Z', '2025-01-02 12:52:00Z', 'E1', 'C5'),
   (225, 'UA', 698, 'SEA', 'SFO', '2025-01-02 09:54:00Z', '2025-01-02 11:59:00Z', 'E37', 'D34'),
   (226, 'AS', 303, 'SFO', 'SEA', '2025-01-02 10:06:00Z', '2025-01-02 12:11:00Z', 'D36', 'C9'),
   (227, 'WN', 3323, 'SFO', 'DEN', '2025-01-02 10:40:00Z', '2025-01-02 13:59:00Z', 'A4', 'E35'),
   (228, 'OO', 6286, 'SBA', 'SFO', '2025-01-02 10:23:00Z', '2025-01-02 11:47:00Z', 'B46', 'A8'),
   (229, 'OO', 5603, 'PHX', 'SFO', '2025-01-02 10:29:00Z', '2025-01-02 11:41:00Z', 'A2', 'C22'),
   (230, 'CY', 218, 'SFO', 'AUS', '2025-01-02 10:28:00Z', '2025-01-02 15:56:00Z', 'E49', 'C21'),
   (231, 'OO', 5335, 'CEC', 'SFO', '2025-01-02 10:32:00Z', '2025-01-02 12:09:00Z', 'D29', 'D17'),
   (232, 'OO', 5646, 'SFO', 'SBA', '2025-01-02 10:33:00Z', '2025-01-02 11:54:00Z', 'A50', 'E40'),
   (233, 'OO', 5635, 'SFO', 'SNA', '2025-01-02 11:22:00Z', '2025-01-02 12:55:00Z', 'C17', 'D47'),
   (234, 'OO', 6380, 'SFO', 'BOI', '2025-01-02 10:41:00Z', '2025-01-02 13:18:00Z', 'B18', 'C15'),
   (235, 'UA', 662, 'SFO', 'MSP', '2025-01-02 10:52:00Z', '2025-01-02 16:39:00Z', 'B6', 'E11'),
   (236, 'OO', 6270, 'SFO', 'RNO', '2025-01-02 10:43:00Z', '2025-01-02 11:52:00Z', 'C15', 'E10'),
   (237, 'OO', 4975, 'SFO', 'TUS', '2025-01-02 12:23:00Z', '2025-01-02 15:18:00Z', 'D5', 'C12'),
   (238, 'UA', 322, 'SFO', 'SEA', '2025-01-02 10:49:00Z', '2025-01-02 12:54:00Z', 'E29', 'D3'),
   (239, 'WN', 1009, 'LAX', 'SFO', '2025-01-02 11:33:00Z', '2025-01-02 12:45:00Z', 'E12', 'C30'),
   (240, 'OO', 4966, 'SFO', 'SUN', '2025-01-02 11:11:00Z', '2025-01-02 14:15:00Z', 'D39', 'D21'),
   (241, 'UA', 753, 'SFO', 'AUS', '2025-01-02 11:40:00Z', '2025-01-02 17:33:00Z', 'B30', 'D47'),
   (242, 'UA', 242, 'SFO', 'SAN', '2025-01-02 12:00:00Z', '2025-01-02 13:24:00Z', 'B27', 'E27'),
   (243, 'UA', 390, 'SEA', 'SFO', '2025-01-02 11:10:00Z', '2025-01-02 13:08:00Z', 'A17', 'A23'),
   (244, 'OO', 6336, 'RNO', 'SFO', '2025-01-02 11:17:00Z', '2025-01-02 12:17:00Z', 'A45', 'E39'),
   (245, 'OO', 5250, 'MRY', 'SFO', '2025-01-02 11:12:00Z', '2025-01-02 12:28:00Z', 'B33', 'E11'),
   (246, 'UA', 317, 'SAN', 'SFO', '2025-01-02 12:10:00Z', '2025-01-02 13:40:00Z', 'A14', 'A42'),
   (247, 'OO', 5652, 'SFO', 'PSP', '2025-01-02 12:14:00Z', '2025-01-02 13:50:00Z', 'E17', 'B17'),
   (248, 'UA', 1195, 'SFO', 'ORD', '2025-01-02 11:56:00Z', '2025-01-02 18:12:00Z', 'B39', 'B19'),
   (249, 'CY', 714, 'SFO', 'DAL', '2025-01-02 11:40:00Z', '2025-01-02 17:22:00Z', 'C50', 'A19'),
   (250, 'WN', 2779, 'LAX', 'SFO', '2025-01-02 11:58:00Z', '2025-01-02 13:09:00Z', 'B19', 'C27'),
   (251, 'UA', 1722, 'SFO', 'IAH', '2025-01-02 11:58:00Z', '2025-01-02 18:29:00Z', 'E12', 'D6'),
   (252, 'UA', 766, 'JFK', 'SFO', '2025-01-02 11:55:00Z', '2025-01-02 15:21:00Z', 'A16', 'C18'),
   (253, 'UA', 1437, 'ORD', 'SFO', '2025-01-02 12:36:00Z', '2025-01-02 15:09:00Z', 'A33', 'E19'),
   (254, 'UA', 1294, 'LAS', 'SFO', '2025-01-02 12:20:00Z', '2025-01-02 13:45:00Z', 'E7', 'A10'),
   (255, 'UA', 1266, 'SEA', 'SFO', '2025-01-02 12:13:00Z', '2025-01-02 14:11:00Z', 'B32', 'C18'),
   (256, 'UA', 1668, 'SFO', 'EWR', '2025-01-02 12:24:00Z', '2025-01-02 20:34:00Z', 'D37', 'A30'),
   (257, 'OO', 6304, 'BUR', 'SFO', '2025-01-02 12:31:00Z', '2025-01-02 14:01:00Z', 'C7', 'C4'),
   (258, 'WN', 4391, 'SFO', 'STL', '2025-01-02 12:55:00Z', '2025-01-02 18:36:00Z', 'A12', 'D39'),
   (259, 'UA', 236, 'HNL', 'SFO', '2025-01-02 13:19:00Z', '2025-01-02 20:12:00Z', 'B25', 'D26'),
   (260, 'UA', 1705, 'SFO', 'IAH', '2025-01-02 12:51:00Z', '2025-01-02 18:50:00Z', 'E11', 'E32'),
   (261, 'OO', 6490, 'EUG', 'SFO', '2025-01-02 13:00:00Z', '2025-01-02 14:21:00Z', 'D34', 'D29'),
   (262, 'UA', 820, 'SFO', 'ORD', '2025-01-02 13:02:00Z', '2025-01-02 19:11:00Z', 'B45', 'E24'),
   (263, 'AS', 381, 'SFO', 'PDX', '2025-01-02 12:52:00Z', '2025-01-02 14:34:00Z', 'E11', 'B3'),
   (264, 'AS', 305, 'SFO', 'SEA', '2025-01-02 12:59:00Z', '2025-01-02 15:10:00Z', 'C34', 'C41'),
   (265, 'OO', 6273, 'SFO', 'SLC', '2025-01-02 12:57:00Z', '2025-01-02 15:50:00Z', 'C3', 'D36'),
   (266, 'DL', 2254, 'SFO', 'DTW', '2025-01-02 13:05:00Z', '2025-01-02 20:29:00Z', 'E10', 'D30'),
   (267, 'B6', 1435, 'SFO', 'LGB', '2025-01-02 13:34:00Z', '2025-01-02 15:02:00Z', 'B31', 'D48'),
   (268, 'F9', 661, 'DEN', 'SFO', '2025-01-02 13:11:00Z', '2025-01-02 14:35:00Z', 'C3', 'E38'),
   (269, 'UA', 1092, 'EWR', 'SFO', '2025-01-02 13:44:00Z', '2025-01-02 17:05:00Z', 'D13', 'A41'),
   (270, 'US', 1812, 'SFO', 'CLT', '2025-01-02 13:32:00Z', '2025-01-02 21:36:00Z', 'A50', 'A5'),
   (271, 'WN', 2598, 'LAX', 'SFO', '2025-01-02 13:48:00Z', '2025-01-02 14:54:00Z', 'E23', 'C38'),
   (272, 'UA', 216, 'SFO', 'SNA', '2025-01-02 15:23:00Z', '2025-01-02 16:41:00Z', 'C23', 'E6'),
   (273, 'UA', 1060, 'SFO', 'DCA', '2025-01-02 15:19:00Z', '2025-01-02 23:18:00Z', 'D14', 'B18'),
   (274, 'OO', 6326, 'BOI', 'SFO', '2025-01-02 13:51:00Z', '2025-01-02 14:24:00Z', 'D49', 'A43'),
   (275, 'UA', 724, 'HNL', 'SFO', '2025-01-02 14:43:00Z', '2025-01-02 21:33:00Z', 'B26', 'A50'),
   (276, 'OO', 5463, 'SFO', 'SMF', '2025-01-02 13:50:00Z', '2025-01-02 14:32:00Z', 'A13', 'D23'),
   (277, 'UA', 698, 'SFO', 'MCO', '2025-01-02 14:24:00Z', '2025-01-02 22:33:00Z', 'D49', 'B2'),
   (278, 'CY', 1178, 'SFO', 'EWR', '2025-01-02 13:58:00Z', '2025-01-02 22:06:00Z', 'C27', 'D9'),
   (279, 'OO', 6425, 'TUS', 'SFO', '2025-01-02 14:50:00Z', '2025-01-02 15:54:00Z', 'E29', 'D17'),
   (280, 'OO', 5615, 'MFR', 'SFO', '2025-01-02 13:55:00Z', '2025-01-02 15:15:00Z', 'B44', 'E27'),
   (281, 'WN', 3450, 'SFO', 'MDW', '2025-01-02 14:50:00Z', '2025-01-02 20:46:00Z', 'D39', 'B44'),
   (282, 'UA', 1733, 'SFO', 'DEN', '2025-01-02 15:11:00Z', '2025-01-02 18:47:00Z', 'D8', 'D2'),
   (283, 'UA', 1263, 'KOA', 'SFO', '2025-01-02 14:59:00Z', '2025-01-02 21:49:00Z', 'C39', 'E3'),
   (284, 'UA', 1568, 'SFO', 'RDU', '2025-01-02 14:55:00Z', '2025-01-02 23:03:00Z', 'A30', 'A26'),
   (285, 'UA', 1159, 'SFO', 'BOS', '2025-01-02 14:57:00Z', '2025-01-02 23:23:00Z', 'C19', 'A30'),
   (286, 'OO', 5652, 'PSP', 'SFO', '2025-01-02 14:52:00Z', '2025-01-02 16:46:00Z', 'D37', 'A5'),
   (287, 'US', 749, 'CLT', 'SFO', '2025-01-02 15:28:00Z', '2025-01-02 17:47:00Z', 'D17', 'D38'),
   (288, 'UA', 1491, 'SFO', 'DEN', '2025-01-02 15:09:00Z', '2025-01-02 18:45:00Z', 'E31', 'E36'),
   (289, 'WN', 2687, 'SFO', 'LAX', '2025-01-02 15:27:00Z', '2025-01-02 16:31:00Z', 'E42', 'B13'),
   (290, 'DL', 2040, 'SFO', 'JFK', '2025-01-02 15:09:00Z', '2025-01-02 23:20:00Z', 'E2', 'D33'),
   (291, 'OO', 5549, 'SFO', 'AUS', '2025-01-02 15:24:00Z', '2025-01-02 21:11:00Z', 'B42', 'C1'),
   (292, 'AS', 308, 'SEA', 'SFO', '2025-01-02 15:22:00Z', '2025-01-02 17:18:00Z', 'C39', 'A46'),
   (293, 'F9', 662, 'SFO', 'DEN', '2025-01-02 15:16:00Z', '2025-01-02 18:50:00Z', 'C5', 'A8'),
   (294, 'UA', 735, 'DEN', 'SFO', '2025-01-02 16:00:00Z', '2025-01-02 17:19:00Z', 'A32', 'C24'),
   (295, 'UA', 404, 'IAH', 'SFO', '2025-01-02 17:26:00Z', '2025-01-02 19:32:00Z', 'C14', 'A7'),
   (296, 'CY', 210, 'SFO', 'ORD', '2025-01-02 15:42:00Z', '2025-01-02 21:44:00Z', 'A31', 'B46'),
   (297, 'AS', 315, 'SFO', 'SEA', '2025-01-02 19:47:00Z', '2025-01-02 22:16:00Z', 'A8', 'B49'),
   (298, 'WN', 1901, 'SAN', 'SFO', '2025-01-02 15:48:00Z', '2025-01-02 17:09:00Z', 'A23', 'B38'),
   (299, 'OO', 5580, 'SFO', 'SNA', '2025-01-02 16:35:00Z', '2025-01-02 18:03:00Z', 'D40', 'E43'),
   (300, 'AA', 2265, 'DFW', 'SFO', '2025-01-02 16:07:00Z', '2025-01-02 17:41:00Z', 'A4', 'A23'),
   (301, 'OO', 5363, 'SFO', 'ONT', '2025-01-02 16:15:00Z', '2025-01-02 17:32:00Z', 'A10', 'A26'),
   (302, 'OO', 5609, 'SFO', 'PDX', '2025-01-02 17:01:00Z', '2025-01-02 18:42:00Z', 'E49', 'D4'),
   (303, 'OO', 5645, 'MFR', 'SFO', '2025-01-02 16:15:00Z', '2025-01-02 17:35:00Z', 'A25', 'E49'),
   (304, 'OO', 4976, 'SFO', 'STL', '2025-01-02 16:37:00Z', '2025-01-02 22:27:00Z', 'C35', 'A2'),
   (305, 'OO', 6217, 'BUR', 'SFO', '2025-01-02 16:44:00Z', '2025-01-02 17:55:00Z', 'D50', 'A14'),
   (306, 'WN', 1276, 'SFO', 'LAX', '2025-01-02 16:25:00Z', '2025-01-02 17:32:00Z', 'B8', 'D22'),
   (307, 'OO', 6238, 'ACV', 'SFO', '2025-01-02 16:25:00Z', '2025-01-02 17:36:00Z', 'E24', 'A39'),
   (308, 'OO', 5190, 'SFO', 'ASE', '2025-01-02 17:08:00Z', '2025-01-02 20:17:00Z', 'C9', 'E6'),
   (309, 'OO', 4627, 'SFO', 'SLC', '2025-01-02 16:43:00Z', '2025-01-02 19:41:00Z', 'C32', 'C4'),
   (310, 'OO', 6476, 'SFO', 'MFR', '2025-01-02 16:38:00Z', '2025-01-02 18:16:00Z', 'B26', 'D33'),
   (311, 'UA', 486, 'SFO', 'LAS', '2025-01-02 16:52:00Z', '2025-01-02 18:24:00Z', 'D25', 'E8'),
   (312, 'DL', 214, 'SFO', 'DTW', '2025-01-02 19:09:00Z', '2025-01-03 02:20:00Z', 'C6', 'E35'),
   (313, 'CY', 592, 'SFO', 'PSP', '2025-01-02 16:54:00Z', '2025-01-02 18:14:00Z', 'B40', 'B9'),
   (314, 'UA', 529, 'SNA', 'SFO', '2025-01-02 17:01:00Z', '2025-01-02 18:15:00Z', 'D28', 'B30'),
   (315, 'UA', 372, 'MSP', 'SFO', '2025-01-02 17:39:00Z', '2025-01-02 19:19:00Z', 'E28', 'C18'),
   (316, 'AA', 1213, 'SFO', 'DFW', '2025-01-02 18:20:00Z', '2025-01-03 00:19:00Z', 'E39', 'A42'),
   (317, 'AS', 341, 'PSP', 'SFO', '2025-01-02 17:15:00Z', '2025-01-02 18:37:00Z', 'D40', 'D15'),
   (318, 'OO', 5418, 'SBP', 'SFO', '2025-01-02 18:11:00Z', '2025-01-02 19:09:00Z', 'C31', 'D39'),
   (319, 'CY', 193, 'EWR', 'SFO', '2025-01-02 17:29:00Z', '2025-01-02 20:59:00Z', 'E20', 'E40'),
   (320, 'UA', 1723, 'SFO', 'KOA', '2025-01-02 17:26:00Z', '2025-01-02 21:02:00Z', 'E18', 'D41'),
   (321, 'UA', 1762, 'SFO', 'IAH', '2025-01-02 17:37:00Z', '2025-01-02 23:11:00Z', 'C40', 'C37'),
   (322, 'CY', 720, 'SFO', 'DAL', '2025-01-02 17:23:00Z', '2025-01-02 22:47:00Z', 'D13', 'D23'),
   (323, 'CY', 963, 'SAN', 'SFO', '2025-01-02 17:36:00Z', '2025-01-02 19:05:00Z', 'B1', 'E32'),
   (324, 'OO', 5255, 'SFO', 'EUG', '2025-01-02 17:27:00Z', '2025-01-02 19:02:00Z', 'C7', 'B2'),
   (325, 'CY', 960, 'SFO', 'SAN', '2025-01-02 17:32:00Z', '2025-01-02 18:50:00Z', 'C3', 'C4'),
   (326, 'UA', 1419, 'MSY', 'SFO', '2025-01-02 17:46:00Z', '2025-01-02 20:07:00Z', 'C26', 'E49'),
   (327, 'WN', 1585, 'SFO', 'LAX', '2025-01-02 17:46:00Z', '2025-01-02 19:31:00Z', 'A12', 'A12'),
   (328, 'DL', 1505, 'MSP', 'SFO', '2025-01-02 17:47:00Z', '2025-01-02 19:48:00Z', 'A33', 'B37'),
   (329, 'US', 686, 'PHX', 'SFO', '2025-01-02 17:59:00Z', '2025-01-02 19:05:00Z', 'C28', 'C11'),
   (330, 'AS', 302, 'SEA', 'SFO', '2025-01-02 18:00:00Z', '2025-01-02 20:04:00Z', 'B28', 'E17'),
   (331, 'UA', 1552, 'RDU', 'SFO', '2025-01-02 18:08:00Z', '2025-01-02 20:51:00Z', 'B15', 'D48'),
   (332, 'UA', 697, 'LAS', 'SFO', '2025-01-02 17:55:00Z', '2025-01-02 19:14:00Z', 'E37', 'B31'),
   (333, 'AA', 219, 'LAX', 'SFO', '2025-01-02 17:54:00Z', '2025-01-02 19:05:00Z', 'C27', 'E34'),
   (334, 'OO', 5425, 'ONT', 'SFO', '2025-01-02 18:04:00Z', '2025-01-02 19:23:00Z', 'C46', 'A14'),
   (335, 'WN', 1861, 'SFO', 'PHX', '2025-01-02 20:49:00Z', '2025-01-02 23:31:00Z', 'C31', 'B42'),
   (336, 'OO', 5631, 'SFO', 'BUR', '2025-01-02 18:10:00Z', '2025-01-02 19:29:00Z', 'D26', 'E29'),
   (337, 'UA', 720, 'SFO', 'AUS', '2025-01-02 18:13:00Z', '2025-01-02 23:41:00Z', 'E10', 'D1'),
   (338, 'UA', 1581, 'SFO', 'OGG', '2025-01-02 18:15:00Z', '2025-01-02 22:06:00Z', 'B40', 'E18'),
   (339, 'OO', 5227, 'SFO', 'SAN', '2025-01-02 18:26:00Z', '2025-01-02 19:59:00Z', 'E33', 'E50'),
   (340, 'CY', 941, 'LAX', 'SFO', '2025-01-02 18:24:00Z', '2025-01-02 19:39:00Z', 'D4', 'A22'),
   (341, 'AA', 1459, 'ORD', 'SFO', '2025-01-02 18:21:00Z', '2025-01-02 21:11:00Z', 'D42', 'B25'),
   (342, 'OO', 5442, 'SFO', 'RDD', '2025-01-02 18:19:00Z', '2025-01-02 19:35:00Z', 'E21', 'B9'),
   (343, 'AA', 69, 'MIA', 'SFO', '2025-01-02 18:31:00Z', '2025-01-02 21:33:00Z', 'B11', 'B15'),
   (344, 'OO', 6220, 'DFW', 'SFO', '2025-01-02 19:01:00Z', '2025-01-02 20:40:00Z', 'D35', 'E4'),
   (345, 'UA', 1670, 'SFO', 'HNL', '2025-01-02 18:42:00Z', '2025-01-02 22:52:00Z', 'A15', 'C18'),
   (346, 'DL', 435, 'JFK', 'SFO', '2025-01-02 18:57:00Z', '2025-01-02 22:25:00Z', 'D35', 'C33'),
   (347, 'UA', 508, 'SEA', 'SFO', '2025-01-02 19:01:00Z', '2025-01-02 21:05:00Z', 'C16', 'B8'),
   (348, 'UA', 1523, 'BOS', 'SFO', '2025-01-02 21:19:00Z', '2025-01-03 01:19:00Z', 'E7', 'B32'),
   (349, 'CY', 593, 'PSP', 'SFO', '2025-01-02 19:03:00Z', '2025-01-02 20:21:00Z', 'C13', 'A47'),
   (350, 'UA', 741, 'ORD', 'SFO', '2025-01-02 19:44:00Z', '2025-01-02 22:14:00Z', 'A16', 'C32'),
   (351, 'WN', 3414, 'SFO', 'SAN', '2025-01-02 19:43:00Z', '2025-01-02 21:10:00Z', 'E3', 'D46'),
   (352, 'UA', 404, 'SFO', 'PDX', '2025-01-02 19:42:00Z', '2025-01-02 21:24:00Z', 'B48', 'A30'),
   (353, 'UA', 637, 'SFO', 'SNA', '2025-01-02 19:32:00Z', '2025-01-02 20:49:00Z', 'D40', 'A23'),
   (354, 'OO', 5573, 'SAT', 'SFO', '2025-01-02 21:13:00Z', '2025-01-02 22:57:00Z', 'D34', 'E33'),
   (355, 'AA', 219, 'SFO', 'LAX', '2025-01-02 20:03:00Z', '2025-01-02 22:00:00Z', 'E27', 'D38'),
   (356, 'OO', 5600, 'BUR', 'SFO', '2025-01-02 19:55:00Z', '2025-01-02 21:21:00Z', 'A7', 'A27'),
   (357, 'CY', 947, 'LAX', 'SFO', '2025-01-02 20:38:00Z', '2025-01-02 22:06:00Z', 'D28', 'C15'),
   (358, 'WN', 138, 'SFO', 'LAS', '2025-01-02 20:26:00Z', '2025-01-02 21:49:00Z', 'B35', 'E31'),
   (359, 'OO', 5302, 'SFO', 'PSC', '2025-01-02 20:29:00Z', '2025-01-02 22:28:00Z', 'C9', 'A15'),
   (360, 'CY', 748, 'SFO', 'SEA', '2025-01-02 20:46:00Z', '2025-01-02 23:17:00Z', 'D7', 'E25'),
   (361, 'UA', 236, 'SFO', 'EWR', '2025-01-02 20:41:00Z', '2025-01-03 05:04:00Z', 'D12', 'B47'),
   (362, 'OO', 6503, 'SFO', 'EUG', '2025-01-02 20:54:00Z', '2025-01-02 22:27:00Z', 'A50', 'E49'),
   (363, 'WN', 1174, 'LAS', 'SFO', '2025-01-02 20:58:00Z', '2025-01-02 22:19:00Z', 'C42', 'D33'),
   (364, 'AS', 744, 'SFO', 'SLC', '2025-01-02 20:52:00Z', '2025-01-02 23:33:00Z', 'B11', 'A39'),
   (365, 'WN', 4992, 'SFO', 'PHX', '2025-01-02 21:49:00Z', '2025-01-03 00:32:00Z', 'D19', 'E15'),
   (366, 'UA', 469, 'EWR', 'SFO', '2025-01-02 23:07:00Z', '2025-01-03 02:27:00Z', 'E3', 'D19'),
   (367, 'UA', 1163, 'SFO', 'EWR', '2025-01-02 21:44:00Z', '2025-01-03 05:45:00Z', 'D19', 'C17'),
   (368, 'DL', 2337, 'SFO', 'ATL', '2025-01-02 21:44:00Z', '2025-01-03 05:23:00Z', 'B4', 'A39'),
   (369, 'OO', 6432, 'SFO', 'EUG', '2025-01-02 22:24:00Z', '2025-01-02 23:57:00Z', 'E11', 'A4'),
   (370, 'US', 898, 'SFO', 'CLT', '2025-01-02 22:24:00Z', '2025-01-03 06:16:00Z', 'A45', 'A24'),
   (371, 'UA', 292, 'SFO', 'MCO', '2025-01-02 22:30:00Z', '2025-01-03 06:37:00Z', 'C7', 'C5'),
   (372, 'OO', 5600, 'SFO', 'MFR', '2025-01-02 22:36:00Z', '2025-01-03 00:01:00Z', 'E42', 'E38'),
   (373, 'UA', 263, 'LAX', 'SFO', '2025-01-02 22:48:00Z', '2025-01-03 00:04:00Z', 'B22', 'E27'),
   (374, 'OO', 5414, 'SFO', 'RDM', '2025-01-02 22:32:00Z', '2025-01-03 00:12:00Z', 'A46', 'C18'),
   (375, 'UA', 1241, 'SFO', 'EWR', '2025-01-02 23:22:00Z', '2025-01-03 07:44:00Z', 'A28', 'E27'),
   (376, 'UA', 522, 'SFO', 'PDX', '2025-01-02 22:55:00Z', '2025-01-03 00:42:00Z', 'A10', 'E39'),
   (377, 'UA', 724, 'SFO', 'ORD', '2025-01-02 23:05:00Z', '2025-01-03 05:20:00Z', 'B40', 'D23'),
   (378, 'UA', 156, 'SFO', 'MSY', '2025-01-02 23:22:00Z', '2025-01-03 05:24:00Z', 'C40', 'A9'),
   (379, 'CY', 358, 'SFO', 'BOS', '2025-01-02 22:52:00Z', '2025-01-03 07:31:00Z', 'B23', 'A44'),
   (380, 'DL', 1370, 'SFO', 'JFK', '2025-01-02 23:04:00Z', '2025-01-03 07:36:00Z', 'E10', 'A49'),
   (381, 'UA', 1729, 'SFO', 'IAD', '2025-01-02 23:10:00Z', '2025-01-03 07:35:00Z', 'D32', 'E42'),
   (382, 'CY', 34, 'SFO', 'JFK', '2025-01-02 23:15:00Z', '2025-01-03 07:54:00Z', 'D28', 'E25'),
   (383, 'DL', 1880, 'SFO', 'ATL', '2025-01-02 00:53:00Z', '2025-01-02 08:27:00Z', 'E2', 'A29'),
   (384, 'UA', 1523, 'SFO', 'EWR', '2025-01-02 23:39:00Z', '2025-01-03 07:43:00Z', 'B9', 'D15'),
   (385, 'US', 426, 'PHX', 'SFO', '2025-01-02 00:18:00Z', '2025-01-02 01:16:00Z', 'D47', 'C42');
   ```

   <br />

   <br />

3. Run the following query to verify that the tables are populated:

   ```sql
   SELECT * FROM flights LIMIT 10;
   SELECT * FROM airports LIMIT 10;
   ```

## Create tokenized columns and search indexes

Use Spanner built-in text search capabilities to enable QueryData to accurately map unstructured natural language phrases, such as typos or partial names, to specific values in your database. This requires generating a hidden `TOKENLIST` column that breaks your strings down into `n-grams`, and building a search index on that column.

To create tokenized columns and search indexes, execute the following SQL statements:

1. Create the token column and index for airport names:

   ```sql
   ALTER TABLE `airports` ADD COLUMN `name_tokens` TOKENLIST AS (TOKENIZE_SUBSTRING(`name`)) STORED HIDDEN;
   CREATE SEARCH INDEX `airports_name_idx` ON `airports`(`name_tokens`);
   ```
2. Create the token column and index for airport cities:

   ```sql
   ALTER TABLE `airports` ADD COLUMN `city_tokens` TOKENLIST AS (TOKENIZE_SUBSTRING(`city`)) STORED HIDDEN;
   CREATE SEARCH INDEX `airports_city_idx` ON `airports`(`city_tokens`);
   ```

## Create a context set in Spanner Studio

In this section, create a context set named `flights-assistant`. This context set doesn't include any context set file uploaded to it.

1. In the Google Cloud console, go to the Spanner page.


   [Go to Spanner](https://console.cloud.google.com/spanner)
2. Select an instance from the list, and then select a database.

3. In the navigation menu, click **Spanner Studio**.

4. In the **Explorer pane** , next to **Context sets** , click **View actions ()**.

5. Click **Create context set**.

6. In **Context set name** , enter `flights-assistant`.

7. Click **Create**.

## Test QueryData in Studio

In this section, use the `flights-assistant` context set by asking natural language questions to generate a SQL query.

Since the context set doesn't have any context set file uploaded to it, even after asking a question with context such as `nighttime traffic`, QueryData generates a sub-optimal query.


1. In the **Explorer pane** , next to your context set, click **View actions ()**.
2. Click **Test context set**.
3. In the query editor, click **Generate SQL using QueryData with: flights-assistant**.
4. Enter the following natural language question to generate a SQL query, and click **Generate**.

       Find flights from SFO to JFK.

   Review the SQL query. Notice that QueryData generates the correct SQL for this unambiguous question.

   ```sql
     SELECT
       *
     FROM
       flights
     WHERE
       departure_airport = 'SFO'
       AND arrival_airport = 'JFK';
   ```
5. In the **Generate SQL using QueryData with: flights-assistant** window, click **Edit**.

6. Enter the following natural language question to generate a SQL query, and click **Update**.

       Tell me flights that can help me beat nighttime traffic if traveling from New York


   The database fails to understand the term `nighttime` traffic. This might prevent it from generating a SQL query or cause it to generate a query that ignores the term, as the following query shows.

   > [!NOTE]
   > **Note:** GenAI models are nondeterministic, meaning the same prompt may yield different responses across separate calls due to the probabilistic nature of the output generation.

   ```sql
   -- The database schema does not contain information about traffic.
   -- Returning all flights departing from New York airports.
   SELECT
     f.airline,
     f.flight_number,
     a.name AS departure_airport_name,
     f.departure_time,
     b.name AS arrival_airport_name,
     f.arrival_time
   FROM
     flights AS f
   JOIN
     airports AS a
     ON f.departure_airport = a.iata
   JOIN
     airports AS b
     ON f.arrival_airport = b.iata
   WHERE
     a.city = 'New York'
   ORDER BY
     f.departure_time;
   ```
7. In the **Generate SQL using QueryData with: flights-assistant** window, click **Edit**.

8. Enter the following natural language question to generate a SQL query, and click **Update**.

       Show me the flight to Houston Intercontinental

   The context set logic generates a query to find an airport with "Houston Intercontinental" in its name. Since no such airport or city exists in the database, the query won't return any rows.

   > [!NOTE]
   > **Note:** GenAI models are nondeterministic, meaning the same prompt may yield different responses across separate calls due to the probabilistic nature of the output generation.

   ```sql
   SELECT
     f.*
   FROM
     `flights` AS f
   JOIN
     `airports` AS a
   ON
     f.arrival_airport = a.id
   WHERE
     a.name LIKE '%Houston Intercontinental%';
   ```

## Generate context for the context set

In this section, you prepare the environment and create a context file that helps improve the context set's querying capabilities.

### Set up your environment

Before you can start generating context, you must prepare your environment.

To set up your environment, perform the following steps:

1. Install Antigravity CLI. For more information, see [Get Started with Antigravity CLI](https://antigravity.google/docs/cli/getting-started/).
2. [Install the Google Cloud CLI](https://docs.cloud.google.com/sdk/docs/install).
3. [Set up Application Default Credentials (ADC)](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt). Run the following commands in your terminal to authenticate and select your project:

   ```bash
   gcloud auth application-default login
   gcloud auth application-default set-quota-project PROJECT_ID
   ```
4. [Install `uv`](https://docs.astral.sh/uv/getting-started/installation/),
   a Python package and project manager that is a prerequisite for the context engineering agent. If you don't already have Python on your system, `uv` can install it for you.

5. [Install the context engineering agent](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/build-context-sets.md.txt#install-agent):

   ```bash
   agy plugin install https://github.com/GoogleCloudPlatform/db-context-enrichment/tree/main/plugin
   ```
6. In your terminal, start the Antigravity CLI.

   ```bash
   agy
   ```
7. Set up a database connection for context generation using [MCP Toolbox](https://mcp-toolbox.dev/documentation/introduction/). The connection is defined in the `.context-engineering/tools.yaml` configuration file.

   To create the `.context-engineering/tools.yaml` configuration file, enter a prompt such as:

       Help me set up a database connection.

   Follow the instructions provided by the skill. For more information about the `tools.yaml` file, see [MCP Toolbox documentation](https://mcp-toolbox.dev/documentation/configuration/).

   > [!NOTE]
   > **Note:** If this connection is not established, the extension returns error messages, such as `Error Discovering tools from mcp_toolbox`, and context generation fails to work.

8. To reload the configuration after the `.context-engineering/tools.yaml` file is created, run the following command in the Antigravity CLI and follow the instruction to reload the toolbox MCP server:

   ```bash
   /mcp
   ```
   1. Select `db-context-engineering_toolbox`.

   2. Select `Restart`.

9. Verify that the MCP toolbox and the context engineering agent plugin are connected and ready to use.

   ```bash
   /mcp
   ```

### Generate template context

In this section, to address the issue from the previous section where

QueryData didn't recognize the term `nighttime traffic`, define the term in the
context set file as traffic occurring between `5:00 PM` and `7:00 PM`.


To generate template context, perform the following steps:

1. Enter the following prompt into the Antigravity CLI:

       Generate a template for the question: "Tell me flights that can help me beat nighttime traffic if traveling from New York" with the following SQL query:

       SELECT
         f.airline,
         f.flight_number,
         a.name AS airport_name,
         f.departure_time
       FROM
         flights f
       JOIN
         airports a
         ON f.departure_airport = a.iata
       WHERE
         a.city = 'New York'
         AND (
           EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') < 17
           OR EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') >= 19
         )
       ORDER BY
         f.departure_time;

2. The agent converts your input into a specific format that refines the context set's performance across a wide range of user queries. For more information, see [Context sets overview](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/context-sets-overview.md.txt#context-sets).

3. Review the generated query template. You can either save the query template as a new agent context file or append it to an existing agent context file.

4. Prompt the agent to save the template:

       Save it to context_set.json.

   The agent creates the file in the same directory, with the following content:

   ```json
   {
     "templates": [
       {
         "nl_query": "Tell me flights that can help me beat nighttime traffic if traveling from New York",
         "sql": "SELECT f.airline, f.flight_number, a.name AS airport_name, f.departure_time FROM flights f JOIN airports a ON f.departure_airport = a.iata WHERE a.city = 'New York' AND (EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') < 17 OR EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') >= 19) ORDER BY f.departure_time;",
         "intent": "Tell me flights that can help me beat nighttime traffic if traveling from New York",
         "manifest": "Tell me flights that can help me beat nighttime traffic if traveling from a given city",
         "parameterized": {
           "parameterized_sql": "SELECT f.airline, f.flight_number, a.name AS airport_name, f.departure_time FROM flights f JOIN airports a ON f.departure_airport = a.iata WHERE a.city = ? AND (EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') < 17 OR EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') >= 19) ORDER BY f.departure_time;",
           "parameterized_intent": "Tell me flights that can help me beat nighttime traffic if traveling from ?"
         }
       }
     ]
   }
   ```

### Generate value search context

In this section, you generate value search context to help context set logic map value phrases to specific values stored in your database columns using string similarity (trigram matching). For example, if a user asks for flights to "Houston Intercontinental," value search can map this to the exact database value of "George Bush Intercontinental Houston Airport."

To generate value search context, perform the following steps:

1. Enter the following prompt into the agent harness:

   ```bash
   Generate a value search on table "airports" for column "city" with concept "Airport City" using match function "TRIGRAM_STRING_MATCH".
   ```
2. Review the generated value search definition. You can either save the value search definition as a new context set file or append it to an existing context set file.

3. Prompt the agent with `Append the context to context_set.json`. This adds the value search definition to the context file created in the earlier section.

4. Enter the database instance and database name for which the context set file was generated.

   The existing context file is updated with the value search definition, with the following content:

   ```json
     {
   "templates": [
     {
       "nl_query": "Tell me flights that can help me beat nighttime traffic if traveling from New York",
       "sql": "SELECT f.airline, f.flight_number, a.name AS airport_name, f.departure_time FROM flights f JOIN airports a ON f.departure_airport = a.iata WHERE a.city = 'New York' AND (EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') < 17 OR EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') >= 19) ORDER BY f.departure_time;",
       "intent": "Tell me flights that can help me beat nighttime traffic if traveling from New York",
       "manifest": "Tell me flights that can help me beat nighttime traffic if traveling from a given city",
       "parameterized": {
         "parameterized_sql": "SELECT f.airline, f.flight_number, a.name AS airport_name, f.departure_time FROM flights f JOIN airports a ON f.departure_airport = a.iata WHERE a.city = ? AND (EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') < 17 OR EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') >= 19) ORDER BY f.departure_time;",
         "parameterized_intent": "Tell me flights that can help me beat nighttime traffic if traveling from ?"
       }
     }
   ],
   "facets": [],
   "value_searches": [
     {
       "query": "SELECT CAST(T.`name` AS STRING) AS value, 'name' AS `columns`, 'airport name' AS concept_type, 1 - SCORE_NGRAMS(T.`name_tokens`, CAST($value AS STRING)) AS distance, JSON '{}' AS context FROM `airports` AS T WHERE SEARCH_NGRAMS(T.`name_tokens`, CAST($value AS STRING)) ",
       "concept_type": "airport name",
       "description": "String similarity using Spanner Search Indexes."
     },
     {
       "query": "SELECT CAST(T.`city` AS STRING) AS value, 'city' AS `columns`, 'airport city' AS concept_type, 1 - SCORE_NGRAMS(T.`city_tokens`, CAST($value AS STRING)) AS distance, JSON '{}' AS context FROM `airports` AS T WHERE SEARCH_NGRAMS(T.`city_tokens`, CAST($value AS STRING)) ",
       "concept_type": "airport city",
       "description": "String similarity using Spanner Search Indexes."
     }
   ]
   }
   ```

## Upload the context set file to the QueryData

In this section, you upload the context set file to QueryData, so that it improves the QueryData's SQL generation capabilities on your database.

To upload the context, perform the following steps:

1. In the Google Cloud console, go to the Spanner page.


   [Go to Spanner](https://console.cloud.google.com/spanner)
2. Select an instance from the list, and then select a database.

3. In the navigation menu, click **Spanner Studio**.

4. In the **Explorer pane** , under **Context sets** and next to the
   `flights-assistant` context set, click the **View actions** () icon.

5. Click **Edit context set**.

6. Click **Browse** in the **Upload context file** section, and then select the context set file generated earlier.

7. Click **Save**.

## Generate SQL query using QueryData

In this section, you use the context set file you uploaded to ask natural language questions. This lets you verify that QueryData correctly understands and applies definitions for terms like `nighttime traffic` and other related phrases.

> [!NOTE]
> **Note:** GenAI models are nondeterministic, meaning the same prompt may yield different responses across separate calls due to the probabilistic nature of the output generation.

To generate SQL queries, perform the following steps:

1. In the **Explorer** pane, next to your context set, click **View actions ()**.
2. Click **Test context set**.
3. In the query editor, click **Generate SQL using QueryData with: flights-assistant**.
4. To generate a SQL query, enter the following natural language question,
   and then click **Generate**.

       Tell me flights that can help me beat nighttime traffic if traveling from New York

   The generated SQL query looks similar to the following:

   ```sql
   SELECT
     f.airline,
     f.flight_number,
     a.name AS airport_name,
     f.departure_time
   FROM
     flights f
   JOIN
     airports a ON f.departure_airport = a.iata
   WHERE
     a.city = 'New York'
     AND (
       EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') < 17
       OR EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') >= 19
     )
   ORDER BY
     f.departure_time;
   ```

   This is the same question you added to QueryData's context. Observe that QueryData can now accurately interpret the term `nighttime traffic`.

   Although the context originates from one particular question, QueryData uses it to enhance SQL generation for a wide range of similar questions.
5. In the **Generate SQL using QueryData with: flights-assistant** window, click **Edit**.

6. Enter the following similar question to generate a SQL query, and click **Update**.

       What are the flights that can help me avoid evening traffic if departing from Boston

   Since the question replaces the term `nighttime traffic` with a similar term, `evening traffic`, QueryData provides a consistent answer to this question by applying the same interpretation.

   The generated SQL query looks similar to the following:

   ```sql
   -- What are the flights that can help me avoid evening traffic if departing from Boston
   SELECT
     f.airline,
     f.flight_number,
     a.name AS airport_name,
     f.departure_time
   FROM
     flights f
   JOIN
     airports a
   ON
     f.departure_airport = a.iata
   WHERE
     a.city = 'Boston'
     AND (
       EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') < 17
       OR EXTRACT(HOUR FROM f.departure_time AT TIME ZONE 'UTC') >= 19
     )
   ORDER BY
     f.departure_time;
   ```
7. Enter the following question to generate a SQL query, and click **Update**.

       Show me the flight to Houston Intercontinental

   The generated SQL query looks similar to the following:

   ```sql
   SELECT
     f.*
   FROM
     flights AS f
   INNER JOIN
     airports AS a
   ON
     f.arrival_airport = a.iata
   WHERE
     a.name = 'George Bush Intercontinental Houston Airport'
   ```

   Observe that QueryData can now accurately interpret that "Houston Intercontinental" relates to the "George Bush Intercontinental Houston Airport" in the database.

## Integrate QueryData with your application

In this section, you create a data agent for a flight-finding application. This data agent provides a conversational interface to the `flights` and `airports` tables that you created earlier. It also explains how to create and integrate this data agent into your application using [Agent Development Kit (ADK)](https://github.com/google/adk-python), the Gemini Data Analytics QueryData MCP tool, and a context set to improve quality of the responses.

> [!NOTE]
> **Note:** GenAI models are nondeterministic, meaning the same prompt may yield different responses across separate calls due to the probabilistic nature of the output generation.

1. Download [MCP Toolbox](https://mcp-toolbox.dev/documentation/introduction/#install-toolbox) version 1.14.0 or later. MCP Toolbox exposes the data agent as a tool for applications to connect with. The MCP Toolbox differs from the context engineering agent you installed earlier, which generates context.

2. Set up [Application Default Credentials (ADC)](https://docs.cloud.google.com/docs/authentication/set-up-adc-local-dev-environment.md.txt).

   ```bash
   gcloud auth application-default login
   gcloud auth application-default set-quota-project PROJECT_ID
   ```
3. Find the ID of the context set you created earlier. For more information about how to find the context set ID, see [Find the context set ID](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/inspect-data-agent.md.txt#find-context-id).

4. Append the following to the `.context-engineering/tools.yaml` configuration (or `tools.yaml` in your working directory) to connect to the data agent using the MCP Toolbox. For more information, see [Gemini Data Analytics Source](https://mcp-toolbox.dev/integrations/cloudgda/source/) and [Gemini Data Analytics QueryData tool](https://mcp-toolbox.dev/integrations/cloudgda/tools/cloud-gda-query/).

   ```yaml
   ---
   kind: source
   name: gda-api-source
   type: cloud-gemini-data-analytics
   projectId: "PROJECT_ID"
   ---
   kind: tool
   name: cloud_gda_query_tool
   type: cloud-gemini-data-analytics-query
   source: gda-api-source
   description: Use this tool to send natural language queries to the Gemini Data Analytics API and receive SQL, natural language answers, and explanations.
   location: "REGION_ID"
   context:
     datasourceReferences:
       spannerReference:
         databaseReference:
           engine: "GOOGLE_SQL"
           projectId: "PROJECT_ID"
           instanceId: "INSTANCE_ID"
           databaseId: "DATABASE_ID"
         agentContextReference:
           contextSetId: "CONTEXT_SET_ID"
   generationOptions:
     generateQueryResult: true
     generateNaturalLanguageAnswer: true
     generateExplanation: true
     generateDisambiguationQuestion: true
   ```

   Replace the following:
   - `PROJECT_ID`: Your Google Cloud project ID.
   - `REGION_ID`: The region of your Spanner instance (for example `us-central1`).
   - `INSTANCE_ID`: The ID of your Spanner instance.
   - `DATABASE_ID`: The name of the database to connect to.
   - `CONTEXT_SET_ID`: The context set ID. For more information about how to find the context set ID, see [Find the context set ID](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/inspect-data-agent.md.txt#find-context-id).
5. Run the MCP Toolbox server with the `tools.yaml` file.

   ```console
   ./toolbox --config PATH_TO_TOOLS_YAML
   ```

   Replace `PATH_TO_TOOLS_YAML` with the path to the
   `tools.yaml` file you created earlier (for example,
   `.context-engineering/tools.yaml` or `tools.yaml`).

   > [!NOTE]
   > **Note:** Don't close the terminal window where the MCP Toolbox server is running.

6. Create an ADK application that invokes [Gemini Data Analytics QueryData tool](https://mcp-toolbox.dev/integrations/cloudgda/tools/cloud-gda-query/) using the MCP Toolbox's Python SDK. For more information about how to use the MCP Toolbox's Python SDK, see the [quickstart for Toolbox](https://mcp-toolbox.dev/documentation/getting-started/local_quickstart/) and for Python ADK, see the [quickstart for ADK](https://google.github.io/adk-docs/get-started/python/).

   1. Create a directory to store the application, for example `flight-assistant-app`.
   2. Change directory to the `flight-assistant-app` directory.

      ```console
      mkdir flight-assistant-app
      cd flight-assistant-app
      ```
   3. Run the following commands under the `flight-assistant-app` directory to create a virtual environment and install required components.

      ```console
      uv init
      uv add google-adk toolbox-core google-genai
      ```
   4. Set up an ADK agent.

      1. Create an ADK agent.

         ```console
         uv run adk create my_agent
         ```
      2. Select the `gemini-2.5-flash` model, or newer.

      3. Select **Google AI** , and enter your Gemini API key. For more information about how to find your API key, see [Using Gemini API keys](https://ai.google.dev/gemini-api/docs/api-key). (Alternatively, if you don't need a free trial, you can select **Vertex AI** , specify a Google Cloud project with billing enabled, and enter `global` when prompted for the Google Cloud region (`Enter Google Cloud region`) so that `GOOGLE_CLOUD_LOCATION=global` is set in `my_agent/.env`).

   5. Replace the contents of the `agent.py` file with the following Flight Data Assistant sample application code.

      ```python
      from typing import cast

      from google.adk.agents.llm_agent import Agent
      from google.adk.agents.llm_agent import ToolUnion

      from toolbox_core import ToolboxSyncClient

      TOOLBOX_URL = "http://127.0.0.1:5000"

      INSTRUCTION = """
      # ROLE
      You are a friendly and factual flight data assistant. Your goal is to help users find the best flights for their needs by providing accurate information with a helpful, professional tone.
      - use the Query Data Tool to answer the user's question, if the tool fails to generate a valid query, ask the user to clarify their question.

      # OPERATIONAL CONSTRAINTS
      - TOOL LIMITATION: You only have access to the Query Data Tool. Do not claim to have capabilities beyond what this tool provides.
      - TRANSPARENCY POLICY: Maintain a seamless user experience. Never mention that you are using a tool, querying a database, or generating SQL. Frame all responses as your own direct assistance.
      - SCOPE MANAGEMENT: If a user asks for something beyond your capabilities, politely state that you cannot perform that specific task. Guide the user towards what you can help with.

      # COMMUNICATION STYLE
      - Be concise and scannable when listing answers.
      - Maintain a helpful, professional persona.

      =====

      # QUERY DATA TOOL

      Inputs:
      1. query: A natural language formulation of a database query.

      Outputs: (all optional)
      1. disambiguation_question: Clarification questions or comments where the tool needs the users' input.
      2. generated_query: The generated query for the user query.
      3. intent_explanation: An explanation for why the tool produced `generated_query`.
      4. query_result: The result of executing `generated_query`.
      5. natural_language_answer: The natural language answer that summarizes the `query` and `query_result`.

      Usage guidance:
      1. If `disambiguation_question` is produced, then solicit the needed inputs from the user and try the tool with a new `query` that has the needed clarification.
      2. If `natural_language_answer` is produced, use `intent_explanation` and `generated_query` to see if you need to clarify any assumptions for the user.
      3. If the tool output indicates failure or empty results, explain that clearly using the provided reasoning.
      """

      client = ToolboxSyncClient(TOOLBOX_URL)

      mcp_tool = client.load_tool("cloud_gda_query_tool")

      root_agent = Agent(
          model="gemini-2.5-flash",  # Or newer.
          name="root_agent",
          instruction=INSTRUCTION,
          tools=cast(list[ToolUnion], [mcp_tool]),
      )
      ```

   > [!NOTE]
   > **Note:** The instruction contains a system prompt that sets up a `flight assistant` data agent. It also instructs the agent how to use the Gemini Data Analytics QueryData tool you set up in the `tools.yaml` file you created earlier.

7. To start the application, run the following commands under the `flight-assistant-app` directory. Access the ADK web server at `http://127.0.0.1:8000`.

   ```console
   uv run adk web --port 8000
   ```
8. Enter any text, such as `hello`, to start interacting with the agent.

   The ADK agent answers general questions and calls the required MCP tools.
9. Enter the following flight-related question.

       How many flights depart from the west side?


   The MCP tool is called to answer this question. However, since the term `the west` is ambiguous and doesn't specify any airports, the MCP tool returns a disambiguation question which the agent uses to construct a response.

       I cannot determine how many flights depart from the 'west side' as the database does not contain information about which airports are considered to be on the 'west side'. However, I can help you with questions like:

       1. How many flights depart from a specific airport?

       2. What are the departure airports for all flights?

       3. How many flights depart from each airport? Would you like to rephrase your question based on these options?

10. Enter a question similar to that in the query template generated for the agent.

        Help me find flights from San Francisco that avoid the evening rush hour.

    Based on the QueryData context added earlier, the MCP tool understands that `evening traffic` occurs between 5 PM and 7 PM. The MCP tool returns the associated data for the agent to use in constructing its response.

        Here are the flights departing from San Francisco that avoid the evening rush hour (defined as 5 PM to 7 PM):

        * UA 1532 departing at 05:50:00
        * UA 1158 departing at 05:57:00
        * CY 922 departing at 06:38:00
        * OO 5441 departing at 07:08:00
        * UA 616 departing at 07:14:00
        * AA 24 departing at 07:14:00
        * B6 434 departing at 08:00:00
        * AA 242 departing at 08:18:00
        * UA 1739 departing at 08:22:00
        * OO 6336 departing at 08:32:00
        * US 1784 departing at 08:47:00
        * DL 1631 departing at 09:00:00
        * DL 1106 departing at 09:06:00
        * OO 5427 departing at 09:06:00
        * CY 352 departing at 09:25:00

11. Enter a question based on the concept type that you added in the QueryData agent context.

        Show me the flight to Houston Intercontinental

    Based on the value search context added earlier, the agent understands that "Houston Intercontinental" relates to "George Bush Intercontinental Houston Airport" (airport code IAH) and returns the associated data for the agent to use in constructing its response.

        Here are the flights heading to Houston Intercontinental (IAH):

        * Flight UA 1285 departs from SFO and arrives at IAH on 2025-01-01 at 15:20:00Z.
        * Flight F9 1056 departs from SFO and arrives at IAH on 2025-01-02 at 12:09:00Z.
        * Flight UA 1722 departs from SFO and arrives at IAH on 2025-01-02 at 18:29:00Z.
        * Flight UA 1705 departs from SFO and arrives at IAH on 2025-01-02 at 18:50:00Z.
        * Flight UA 1762 departs from SFO and arrives at IAH on 2025-01-02 at 23:11:00Z.

## Iterate agent performance

The ADK web UI lets you inspect the request and response from the Gemini Data Analytics QueryData MCP tool. You can use this response to observe the tool responses such as generated SQL query, result set, intent explanation, disambiguation question, and natural language answer, to help you confirm the correctness of your agent's responses.

For example, for the input text `How many flights depart from the west side?`
that you entered earlier, click the agent bubble. In the **Event** tab in the
left navigation, expand the `functionResponse` to see the following response.

    "{"disambiguationQuestion": ["[NOT_ENOUGH_INFO] The database schema does not
    contain information about which airports are on the 'west side'. Therefore, I
    cannot determine how many flights depart from the west side.Possible alternative
    questions: 1. How many flights depart from a specific airport? 2. What are the
    departure airports for all flights? 3. How many flights depart from each
    airport?"]}"

### Refine response accuracy

You can continuously refine the accuracy of responses from the Gemini Data Analytics QueryData tool by adding additional context. Use the context engineering agent to generate context, and then upload the updated context set file to the existing `flights-assistant` data agent. For more information, see [Manage context sets in Spanner Studio](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/manage-data-agents.md.txt). The console immediately ingests new context after you upload it, enabling you to enhance the agent's accuracy without any application downtime.

### Multiple agents

In your development environment, you can perform A/B testing on multiple data agent contexts by assigning distinct names to tools in your `tools.yaml` file. For example, you can create unique `tools.yaml` configurations by defining two `cloud-gemini-data-analytics-query` tools with different names, such as `cloud_gda_query_tool_v1` and `cloud_gda_query_tool_v2`. This setup lets you implement application logic that programmatically selects the required context version by choosing the corresponding tool name.

The following example `tools.yaml` shows how to set up multiple data agents for a database source:

```yaml
kind: source
name: gda-api-source
type: cloud-gemini-data-analytics
projectId: PROJECT_ID
---
kind: tool
name: cloud_gda_query_tool_v1
type: cloud-gemini-data-analytics-query
source: gda-api-source
context:
  datasourceReferences:
    DB_SOURCE:
      databaseReference: ...
      agentContextReference:
        contextSetId: "V1_YOUR_CONTEXT_SET_ID"
generationOptions: ...
---
kind: tool
name: cloud_gda_query_tool_v2
type: cloud-gemini-data-analytics-query
source: gda-api-source
context:
  datasourceReferences:
    DB_SOURCE:
      databaseReference: ...
      agentContextReference:
        contextSetId: "V2_YOUR_CONTEXT_SET_ID"
generationOptions: ...
```

Replace the following:

- `PROJECT_ID`: your Google Cloud project ID.
- `V1_YOUR_CONTEXT_SET_ID`: the context set ID for version 1.
- `V2_YOUR_CONTEXT_SET_ID`: the context set ID for version 2.
- `DB_SOURCE`: the database source configurations.

## Clean up

After you've finished following this tutorial, delete the resources
that you created to avoid incurring ongoing costs.
The following sections describe how to delete these resources.

### Delete the context set

Before you delete the instance, delete the context set that you created.

1. In the Google Cloud console, go to the Spanner page.


   [Go to Spanner](https://console.cloud.google.com/spanner)
2. Select an instance from the list, and then select a database.

3. In the navigation menu, click **Spanner Studio**.

4. In the **Explorer pane** , next to your context set, click **View actions ()**.

5. Click **Delete context set**.

6. In the **Delete context set** window, enter `flights-assistant`.

7. Click **Confirm**.

### Delete the instance

When you delete the instance that you created in the [before you begin](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/integrate-applications-data-agent.md.txt#before-you-begin) section, you also delete all of the objects you created.

1. In the Google Cloud console, go to the Spanner page.


   [Go to Spanner](https://console.cloud.google.com/spanner)
2. Click the name of the instance that you want to delete, for example, **Test Instance**.

3. Click **Delete instance**.

4. Confirm that you want to delete the instance by entering the instance name and clicking **Delete**.

## What's next

- Learn more about [context sets](https://docs.cloud.google.com/gemini/data-agents/querydata/spanner/context-sets-overview.md.txt).
- Learn how to [define authored context for database data sources](https://docs.cloud.google.com/gemini/data-agents/conversational-analytics-api/data-agent-authored-context-databases.md.txt).