Skip to main content

PRODUCT WALKTHROUGH

Turn the question into SQL you can inspect.

Keep source context, generated logic and result validation together as you explore.

Use the finance connection and the close contract. Selected finance source.
Illustrative workflow · product-based SVG · mock dataOpen full-size screen ↗
Use the finance connection and the close contract.

Select finance_postgres. The example counts posted USD entries for 26 November; invoices are positive and credit entries are negative.

Marked on screen: Selected finance source.

Download the synthetic example ledger: 250 in-scope entries plus three rows excluded by date, currency or status.

Worked example, setup and reference details

Use AI Studio to turn a specific business question into a query you can inspect and reproduce. The useful outcome is a verified query with known assumptions, not an answer that merely sounds plausible.

Before you start​

Connect the intended data source and confirm which database and schema it exposes. Configure an AI provider using your deployment's integration settings. Follow the AI Studio guide for your UI version.

The illustrated SQL worksheet has a separate Execute Query control. In V2 SQL Assistant mode, a runnable generated read query runs as part of answering. A statement that may write data is held until you press Execute Query on the SQL Assistant answer card, inspect the SQL in Run this statement?, and confirm Run. A reply marked not runnable cannot be executed from that reply. Use source credentials restricted to the data and operations you need; a read-only prompt is not a database permission boundary. Use a separate SQL worksheet when you need to inspect SQL before running even a read query.

Ask a question with a testable meaning​

“Show revenue” leaves the date, currency, refunds, and grouping undefined. Instead, specify the source tables, period, inclusion rules, and expected output. For example, after confirming that the named columns exist:

Using only orders, return a read-only SELECT for paid orders from October 1, 2026 inclusive to October 2 exclusive, based on order_date. Group by currency and show order count and sum of amount. Do not join another table. Explain null handling and any assumptions.

This is an illustrative question. Adapt it to your schema and business definition before sending it. If order_date is a timestamp, specify its timezone and the intended day boundary.

Explore and verify​

  1. Select the intended source and schema context in AI Studio. Confirm the connection before sending the question.
  2. Ask the scoped question and read the returned SQL and explanation. In V1, review the SQL, insert it into the editor, and execute it when ready. V2 SQL Assistant can execute generated SQL automatically; inspect its result or execution error.
  3. Check the SQL's tables, filters, joins, grouping, and null handling. Look for duplicate rows introduced by joins or a missing date predicate.
  4. Compare the output with an independent check on a small, known dataset or an approved reference query. Check each currency separately.
  5. Refine the question if the assumptions are wrong. Recheck the SQL after every revision; an earlier correct answer does not validate a later query.
  6. Retain the accepted SQL, source context, parameters, execution time, and validation result in your team's analysis record.

Inspect the generated query​

V2 UI example

The illustration is based on the V2 interface. Controls and layout differ in V1; use the linked product guide for your UI version.

Illustrative SQL result of 120000 USD reconciled against the synthetic finance ledger

The illustrated worksheet follows a finance-close question from the selected PostgreSQL source through SQL review to a returned $120,000 net-sales total. The mock ledger independently reconciles $125,000 of invoices less $5,000 of credits, with a $0 difference. Inspect and validate a generated query before treating it as reusable analysis. Follow the Datasource SQL guide for source selection and worksheet behavior.

Check the answer before sharing it​

Use these checks to decide whether the result answers the question:

RiskCheck
Wrong populationConfirm the date range, status filter, and source environment
Duplicated amountsCompare join cardinality with the expected business key
Misleading totalsKeep currencies separate and document refund handling
Incomplete displayed resultsCheck result limits; use an explicit aggregate for a population total
Expensive queryInspect predicates and the source execution plan before repeated runs

A displayed row limit does not guarantee a cheap source query. AI output can contain invalid SQL or a valid query with the wrong business meaning. An execution error is not an empty result, and an empty result is not proof that the source contains no relevant records.

Move from exploration to an owned check​

When a query becomes a recurring reporting dependency, give it an owner and a documented business definition. Convert important assumptions into data quality checks, and use the workload investigation guide if execution becomes slow.

Review an AI-assisted SQL workflow