The Case for Text-to-SQL Friendly Logical Database Design
Shi Heng Zhang, Zhengjie Miao, Jiannan Wang · 2026
Read The Case for Text-to-SQL Friendly Logical Database Design by Shi Heng Zhang, Zhengjie Miao, Jiannan Wang (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-03145.txt.
Introduction
Zhang, Miao, and Wang argue that database design should also serve language models that write SQL. Classic design tunes tables, keys, and views for correctness and for human-written queries. With text-to-SQL tools, a model now reads the schema as text. Design choices that keep the same meaning can still change how well the model does.
The team names this trait LLM-friendly design and makes it an optimization goal. Three meaning-preserving changes carry it out. Views can bake in common join paths. Workload-aware partitions can prune stray context. Clear names can aid column linking and filter building. Tests on two union benchmarks span many pipelines and model backbones. Gains reached about four percent in execution accuracy. The full mix of all three changes helped in every case. The authors call this a practical, overlooked target on the database side.
Catalog record
| CREATOR | Shi Heng Zhang, Zhengjie Miao, Jiannan Wang |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 69 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2606.03145
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
The Case for Text-to-SQL Friendly Logical Database Design Shi Heng Zhang, Zhengjie Miao, Jiannan Wang Abstract . Logical database design has traditionally optimized database schemas, including tables, columns, keys, constraints, and views, for correctness, integrity, and human-written application queries. LLM-based Text-to-SQL changes the consumer: the schema is now often read as text by a language model, so design choices that preserve database semantics can still change SQL-generation accuracy. We argue that this creates a new design objective alongside the classical ones — LLM-friendly logical database design , the property that a schema is easy for a language model to map from natural language to correct SQL — and treat it as the optimization target of this paper. We instantiate this objective with three semantics-preserving schema transformations that re-purpose classical schema-design ideas: schema abstraction ( +A: logical views that materialize recurring join paths), schema partitioning ( +P: workload-aware logical partitions that prune irrelevant context), and schema renaming ( +R: descriptive identifiers that improve downstream column linking and predicate construction). The three operators compose, and each preserves the underlying database semantics. When historical question–SQL pairs are available, they guide both partitioning and abstraction; in zero-shot settings, renaming applies directly, and abstraction falls back to an ad-hoc per-question variant. We evaluate the resulting schemas on BIRD-Union and Spider-Union across multiple Text-to-SQL pipelines and language model backbones, with gains of up to 4.2% in execution accuracy. The best transformation varies modestly across pipelines and models, with the full +A+P+R consistently improving; multiple operator combinations are competitive on each pipeline. These results show that LLM-friendly logical design is a practical and underexplored database-side optimization target, complementary to existing Text-to-SQL pipelines. 1. Introduction Logical database design depicts how real-world entities and relationships are organized into a relational database ( 12 ) . Traditionally, this process focuses heavily on system efficiency and optimization, prioritizing normal forms, data integrity, and eliminating redundancy over schema semantic clarity. While system efficiency is vital, the resulting schema is still the primary interface for consumption by developers. A well-designed schema should provide clear and domain-aligned abstractions, making it easier to reason about the underlying data and produce the correct SQL queries ( 20 ; 10 ) . In recent years, Text-to-SQL has emerged as a powerful tool to aid the query-writing process, allowing users to interact with databases using natural language questions. Driven by the rapid advancement of large language models (LLMs), this shift has fundamentally changed the consumption of the database schema: instead of being consumed exclusively by developers, the schema is now read and interpreted as textual context by the LLM. Modern Text-to-SQL systems ( 24 ; 26 ; 4 ; 9 ; 27 ) have substantially improved execution accuracy on challenging benchmarks like BIRD ( 19 ) . Despite this progress, most existing work treats the database schema as a fixed input, focusing exclusively on adapting the model, prompt, or decoding process to that schema. Recent empirical studies on schema robustness (e.g., EvoSchema ( 29 ) ) demonstrate that LLMs remain highly fragile to underlying logical design choices and schema evolution, highlighting the urgent need for schema-level optimization. In this paper, we argue that this shift introduces a new optimization objective for logical database design: Text-to-SQL-friendly logical design —the property that a schema is easy for a language model to map from natural language to correct SQL. This objective operates independently of classical design goals, such that schemas that model the same underlying data would differ drastically in their Text-to-SQL-friendliness. For example, highly normalized schemas often require multi-table joins and bridge tables even for relatively simple questions ( 10 ) ; weak or ambiguous identifiers can hinder lexical alignment between the question and the schema; and large enterprise schemas introduce substantial irrelevant context that confuses schema linking and retrieval. Ultimately, the same database schema varies in Text-to-SQL-friendliness depending on how its logical structure is presented to the model. This observation motivates a complementary, database-centric perspective on Text-to-SQL. Rather than only asking how to improve the model for a given schema, we ask whether the schema itself can be transformed to better support the model. Specifically, given a database schema and a historical Text-to-SQL workload (optional), our goal is to construct a transformed schema that increases downstream Text-to-SQL accuracy. Figure 1. Running example illustrating how schema transformations mitigate complementary Text-to-SQL failure modes. To achieve this, we analyze the underlying process by which a language model reads and uses a database schema. To successfully generate a query, the model needs to understand three core dimensions of the schema: its relational structure (how tables connect), its relevance (which tables matter), and its semantics (what the tables and columns mean). To help the model navigate these three dimensions, we propose three corresponding transformations: Schema Abstraction (+A) simplifies the relational structure by exposing recurring joined paths as logical views, Schema Partitioning (+P) organizes the schema into localized partitions to keep only the relevant schema and historical workload, and Schema Renaming (+R) reduces ambiguity by substituting table and column names with more descriptive identifiers. By applying these three operators, we adapt classic database optimization techniques to help language models achieve higher query execution accuracy. Example 1 (Running example). Consider a molecular database, adapted from the BIRD benchmark ( 19 ) , with relations such as molecule , atom , bond , and connected , as shown in Figure 1 . Although this schema is reasonable from a normalized relational-design perspective, it can be difficult for a Text-to-SQL model to use directly. To illustrate Schema Abstraction (+A) , consider question Q_{1} in Figure 1 : “How many elements are there for single bond molecules?” The intended query requires the model to join atom , bond , and molecule . A baseline model may fail to produce this full path, generating an incomplete query over only atom and bond , e.g., \texttt{atom}\Join\texttt{bond} thereby omitting the required context by the question. By applying +A, the framework instead exposes a semantic view, \texttt{atom\_join\_bond\_join\_molecule}, so that the model can express the query as a simple selection and aggregation over a single higher-level relation. To demonstrate Schema Partitioning (+P) , consider question Q_{2} : “What atoms are connected in single type bonds?” The correct query only needs the relationship between bond and connected , projecting the connected atom identifiers: ⬇ 1 SELECT connected . atom_id , connected . atom_id2 2 FROM bond JOIN connected ON ... In contrast, the baseline model may over-join schema elements and introducing an incorrect four-way join with atom twice, while also not correctly projecting the connected atom identifiers. By applying +P, we restrict the context strictly to the relevant partition, \{\texttt{bond},\texttt{connected}\}, and retrieve demonstrations that reference this exact partition, guiding the model toward the correct join and projection patterns. Finally, to show the impact of Schema Renaming (+R) , consider question Q_{3} , which states “How many chemical compounds are identified as carcinogenic?”. This information is in an ambiguous column molecule.label , making it difficult for the model to infer that this column is needed in a carcinogenicity predicate. By applying +R, we expose a clearer, semantically enriched identifier, e.g., \texttt{molecule.label}\rightarrow\texttt{Chem\_Molecules.carcinogenic\_flag}, consequently, establishing a direct lexical alignment between the natural-language question and the schema identifier. The