Storm OpenAPI(en)
  1. Agent Template
Storm OpenAPI(en)
  • Welcome to STORM
    • Introduction
  • Quickstart
    • Getting Started
      • Creating an Agent
      • Account Creation
    • Core Scenario
      • Document Upload
      • Workflow Design
      • Test
      • Deployment
      • Channel Integration
  • Feature Guide
    • Console
      • Agent Management
      • Dashboard
      • Permission Management
    • Agent Template
      • Knowledge Retrieval
      • Character Dialogue
      • Consultation Record Analysis
      • SQL Query
      • News Article
    • Agent Builder
      • Knowledge
        • Documents
        • Folders
        • Feedback
      • Workflow
        • Node Description
          • LLM
          • Search(RAG)
          • API
          • IF ELSE
          • Variable Declaration and Assignment
          • Postprocessing
      • Test
      • Log
      • Dashboard
    • Admin Tools
      • Deployment Management
      • Channel Integration
      • Model Fine-Tuning
      • Training Data Quality Management
      • Other Settings
  • Apis
    • Agent
      • Deploy Agent
      • View Agent Deployment History
      • View Agent
    • Bucket
      • Create Bucket
      • View Bucket
    • Document
      • Document Training Request by file
      • Document Training Request by URL
      • View Documents
      • Delete Document
    • Chat
      • Send Chat (non-stream)
      • Send Chat (stream)
      • Search Context
    • STORM Parse
      • /convert/md
    • Instance Agent
      • Add Instance Session
      • Upload Instance Document
      • Request RAG Source For Query
      • Delete Instance Session
  • Learn More
    • FAQ
    • Pricing
  1. Agent Template

SQL Query

SQL Query Template#

When you use the SQL Query Template, you can input the data you want to extract and generate a prompt-driven example that produces a valid SQL query to retrieve that data.
Group 632960.png
To try generating SQL based on your internal DB structure, modify the relevant sections of the prompt and run a test.


Writing Tips#

SQL should be written based on PostgreSQL syntax.
If the user does not provide sufficient information, first generate clarifying questions to collect the required details.
If the request is logically inconsistent, suggest a correct approach or query structure.
Configure WHERE, JOIN, and GROUP BY clauses at the minimal scope necessary to meet the stated data objective.

Extended Use Cases#

Enter your internal database structure in the [DB Table Description] section of the prompt to generate SQL using actual table and field names.
Template frequently used read queries to automate repeated requests.
Use the generated SQL draft as a reference when integrating with BI tools or data pipelines.

Notes for Modification#

If you edit the actual schema in [DB Table Description], keep column names, data types, and constraints identical to the real DB to avoid errors.
Be careful with reserved words and system column names (e.g., id, status, createdDate) to prevent case/type mismatches.
Before running the generated SQL, check for missing conditions (WHERE), aggregation mistakes, and proper handling of NULL values.
Modified at 2025-10-20 05:41:07
Previous
Consultation Record Analysis
Next
News Article
Built with