OriginChainDB
Ask

Check a question against a known join

Check a question against a known join

Establish the result with explicit SQL, then compare an English question with it. Ask does not guarantee a general SQL join.

Before you run it: Ask must be enabled. A declared relationship provides context; it does not make every join available through natural language.

Check a natural-language join against SQLAsk AI may not express the requested join; keep the SQL query as the reference.
  1. Join customers and ordersRun the explicit SQL join on the sample tables.
  2. Ask the same questionRequest the plan as well as the answer.
  3. Compare the resultsCheck the joined fields and rows against SQL.
  4. Use SQL if neededKeep the explicit query when the plan cannot express the join.

Follow the example

  1. Create the related sample tables.
  2. Run the SQL join.
  3. Submit the English question with show_plan.
  4. Compare the plan and rows; keep SQL if Ask cannot express the request.

Choose the query surface

Use SQL for an exact join. Ask can use declared relationships as context for supported operations, but a question spanning two tables is not a guarantee of a SQL-style join.

Run a controlled join

Set up both tables and their sample rows using the INNER JOIN example. Run its explicit SQL to select orders with their related customer fields. Check the join keys, aliases and selected columns before converting it to an application query.

Evaluate an English question separately

When trying Ask, scope the candidate schemas and request show_plan: true. Compare the returned rows with your known SQL result. If the question cannot express the required shape, use the explicit query instead of accepting a plausible partial answer.

Next steps

Working Ask quickstart · Declare relations · SQL reference

Expected result

The comparison shows whether the question produced the intended relationship and filters.

Continue

Continue to combine matching records.

© 2026 Silicoyn Technologies Pvt Ltd

On this page