Skip to content
Open access

Schema-Aware Query Translation and Tabular Reasoning for Enterprise Databases

Jul 2026 · International Journal of Research in Engineering, Science and Management · 0 citations

TL;DR

Schema-Aware Query Translation and Tabular Reasoning for Enterprise Databases aka Inference-from-RDBMS is presented, an open-source framework designed for schema-aware query translation, dynamic context pruning, and execution-guided tabular inference over complex RDBMS structures.

Abstract

Relational Database Management Systems (RDBMS) hold the vast majority of structured enterprise data. However, applying Large Language Models (LLMs) to perform natural language querying and tabular reasoning directly over relational schemas presents major bottlenecks: full schema injection quickly exhausts context windows, complex join relationships lead to hallucinated SQL syntax, and security risks like invalid query execution constrain enterprise adoption. To overcome these limitations, we present Schema-Aware Query Translation and Tabular Reasoning for Enterprise Databases aka Inference-from-RDBMS, an open-source framework designed for schema-aware query translation, dynamic context pruning, and execution-guided tabular inference over complex RDBMS structures. The framework extracts database metadata to construct an interactive Schema Relationship Graph (SRG), prunes unreferenced tables and foreign-key joins using semantic distance metrics, and passes a minimal schema sub-graph to an execution-validated text-to-SQL generator. We evaluate Inference-from-RDBMS across standard enterprise benchmarks (including SPIDER and real-world multi-table schemas). The experimental results demonstrate that our framework achieves an 88.4% execution accuracy, reduces prompt token overhead by 52%, and cuts end-to-end query translation latency by 41% compared to standard schema-injected baseline models. These results position Inference-from-RDBMS as a robust, secure, and cost-efficient solution for natural language database interfaces in large-scale AI applications.

Read PDF

Similar papers

Jul 2026

GPS-Relational: Generative Problem Solving with Relational Databases

Experimental results demonstrate that GPS-Relational constructs executable reference SQL across existing benchmark and complex generated queries, and that LLM execution accuracy degrades significantly as nesting depth increases up to 15 levels.

Goli Vaisi, P. Sheu · 0 citations
Open access May 2026

SafeQL: Search-based Refinement for Safe and Efficient LLM-based Text-to-SQL

Large language models (LLMs) have advanced Text-to-SQL by enabling natural language interfaces to databases without task-specific fine-tuning. However, existing LLM-based systems remain unreliable, often generating SQL queries that are invalid under the database schema, referencing non-existent tables, attributes, functions, or values. Such errors persist because interactions with the database management system (DBMS) are typically limited to error messages, leaving it in a largely passive role during query refinement. This paper proposes SafeQL, a search-based refinement paradigm that redefines the role of the DBMS as an active guide in the refinement process. Instead of regenerating entire queries after execution failure, SafeQL interprets DBMS feedback to incrementally repair only the erroneous components. Each refinement step is formulated as a guided search within a safe query space , where candidate queries are progressively validated through DBMS execution, thereby converging to an executable query and preventing repeated regeneration of errors. Experiments on the Bird and Spider benchmarks show that SafeQL significantly improves execution accuracy and efficiency compared to regeneration-based methods.

Geonho Lee, Min-Soo Kim · 0 citations
Preprint Aug 2026

Guided Table Retrieval for Structured Data Search

guided table retrieval is presented, a four-phase pipeline that combines deterministic grounding via hash-based predictors, structural exploration of join-graph reachability, LLM-powered disambiguation of sources and targets, and algorithmic merging into minimal, topologically ordered join trees.

Alekh Jindal, J. Pandey, C. Pavlopoulou et al. · 0 citations
Open access Jul 2026

Schema-Guided Prompt Strategies for Text-to-SQL over Relational Databases Using Local LLMs

It is suggested that structured prompt engineering provides a practical alternative to model fine-tuning for locally deployed LLMs, offering an effective balance between SQL generation accuracy, computational efficiency, and data privacy.

Nurjayanti Nurjayanti, A. Adiwijaya, A. Romadhony et al. · 0 citations
Preprint Jul 2026

DRL: A Deterministic Relational Middleware Layer for Transaction-Safe Enterprise NL2SQL Under Schema-Graph Scaling

Deploying natural-language interfaces over enterprise OLTP catalogs fails at scale because semantic parsers collapse under schema-graph scaling, inflating context beyond stable LLM attention budgets. We present DRL (Deterministic Relational Middleware Layer), a safe pipeline interposing between front-ends and SQL backends. DRL comprises dynamic context pruning, relational AST typing, and transactional safeguard verification (EXPLAIN gating and NULL guards) to bound context and flag operational silent divergence (SDop). We evaluate DRL on PostgreSQL and MySQL, contributing (i) an OLTP schema-graph scaling model, (ii) a 1,000-pair Workload Verification Suite, (iii) baselines B0-B3, and (iv) an enterprise NL2SQL failure taxonomy. On PostgreSQL, schema-linked hints (B1) yield a 76% context reduction over naive full-catalog prompting (B0); DRL's dynamic router (B2) reaches a 92% reduction at pruning p95 = 0.58 ms and middleware p95 = 4.6 ms. GPT-4o, Claude Sonnet 4.5, and Gemini 2.5 Flash achieve 52.9%, 52.8%, and 52.1% execution match under a corrected evaluation harness; SDop flags 89-100% of false-positive EX-passing queries. GPT-4o failures are dominated by semantic/filter errors (254/471), while column hallucination is a minor factor (47/471). Crucially, a single regex defect in our evaluation post-processor silently suppressed accuracy and manufactured a false 4-10% cross-vendor gap that vanished when corrected, showing that benchmark code deserves the same scrutiny as the models it scores. DRL reframes enterprise NL2SQL as systems engineering - context bounding, verification, and plan-aware admission - not a leaderboard exercise.

Sanjay Mishra, Divya Chukkapalli, Ganesh R. Naik · 0 citations