A SQL automatic generation method based on prompt learning

The objective of the Structure Query Language (SQL) project is to transform spoken language into SQL commands that can be executed. Typically, creating models that generate SQL requires paired examples of SQL code and natural language queries, and these models are usually limited to specific domains. Traditional approaches struggle with broad applicability. This paper introduces a novel technique for SQL generation, known as TS-PL, which leverages prompt learning to produce functional SQL commands from input queries and data tables. The process begins with the analysis and extraction of essential details from the query; next, an SQL template is crafted and populated to create the SQL code; finally, the generated commands are executed to retrieve data. The study's findings indicate that TS-PL outperforms other methods on the Spider dataset, thereby validating its efficacy. The research underscores the potential of this method to enhance automation in natural language processing and database interactions. This advancement is crucial for easing the burden on database professionals, streamlining data operations, and fostering the evolution of intelligent querying systems.

Authors

Institutions

Publication Details

Published
2025-04-28
DOI
https://doi.org/10.1117/12.3067449
Primary Topic
Advanced Computational Techniques and Applications
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A SQL automatic generation method based on prompt learning

Wang Ying, Cheng Zhang, Mengli Zhou, Xianwen Yu
Advanced Computational Techniques and Applications
article

A SQL automatic generation method based on prompt learning

Wang Ying, Cheng Zhang, Mengli Zhou, Xianwen Yu
article en

Abstract

The objective of the Structure Query Language (SQL) project is to transform spoken language into SQL commands that can be executed. Typically, creating models that generate SQL requires paired examples of SQL code and natural language queries, and these models are usually limited to specific domains. Traditional approaches struggle with broad applicability. This paper introduces a novel technique for SQL generation, known as TS-PL, which leverages prompt learning to produce functional SQL commands from input queries and data tables. The process begins with the analysis and extraction of essential details from the query; next, an SQL template is crafted and populated to create the SQL code; finally, the generated commands are executed to retrieve data. The study's findings indicate that TS-PL outperforms other methods on the Spider dataset, thereby validating its efficacy. The research underscores the potential of this method to enhance automation in natural language processing and database interactions. This advancement is crucial for easing the burden on database professionals, streamlining data operations, and fostering the evolution of intelligent querying systems.

State Grid Corporation of China (China) (CN), ETC International (NL)
Openalex Percentile: Top 96%
Advanced Computational Techniques and Applications
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.