di-agent-query-sql

Generate SQL from natural language requests with Substrait-first planning.

3|Updated May 1, 2026
One-click install
npx skills add https://github.com/IBM/ibm-watsonx-data-integration-skills --skill di-agent-query-sql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: di-agent-query-sql
Source: https://github.com/IBM/ibm-watsonx-data-integration-skills/tree/main/agent/skills/di-agent-query-sql
Command: npx skills add https://github.com/IBM/ibm-watsonx-data-integration-skills --skill di-agent-query-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill turns natural language data requests into executable SQL and reduces the manual effort of translating business questions into database queries.

Core Features & Use Cases

  • Substrait-first SQL generation: Tries a deterministic Substrait workflow before falling back to direct SQL generation.
  • Schema and dialect validation: Verifies project assets, resolves source connections, and maps them to the correct runtime SQL dialect.
  • Resilient fallback handling: Recovers from unsupported expressions or conversion failures by producing database-specific SQL with a concise warning.
  • Use Case: Ask for a grouped report, join, or filtered metric query and get SQL ready for a source database such as PostgreSQL, Snowflake, or BigQuery.

Quick Start

Ask the skill to convert your natural-language question into SQL for the verified source table or asset you want to query.

Frequently Asked Questions about di-agent-query-sql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert natural language to SQL for joins and aggregations?

To convert natural language to SQL, submit your data request to generate schema-verified queries involving filters, joins, and aggregations. The system applies Substrait-first planning and runtime dialect resolution to map queries to your specific source database dialect.

How does Substrait-first SQL generation handle unsupported expressions?

Substrait-first SQL generation handles unsupported expressions through resilient fallback processing. When compilation or conversion fails, it produces database-specific direct SQL generation and returns a concise warning instead of failing the entire operation.

Can I generate SQL queries for different database dialects like PostgreSQL, Snowflake, and BigQuery?

Yes, you can generate SQL queries for different database dialects like PostgreSQL, Snowflake, and BigQuery. The system verifies project assets, resolves source connections, and maps them to the correct runtime SQL dialect during generation.

What is the best way to translate business questions into database queries without manual coding?

The best way to translate business questions into database queries without manual coding is using natural language data request conversion. Provide a grouped report or filtered metric query request to receive executable SQL mapped to your verified source tables.

Do I need schema-verified integration queries to generate SQL from natural language?

Yes, schema-verified integration queries are required to generate SQL from natural language. The system verifies project assets and resolves source connections to ensure the generated SQL matches your database schema and runtime dialect correctly.

Why does my natural language SQL query fail during dialect conversion?

Natural language SQL queries fail during dialect conversion when Substrait compilation encounters unsupported expressions. The system recovers by falling back to direct database-specific SQL generation and providing a concise warning about the conversion issue.