Querying Large Language Models with SQL
Not on the map. Why?
Abstract (arXiv)
In many use-cases, information is stored in text but not available in structured data. However, extracting data from natural language text to precisely fit a schema, and thus enable querying, is a challenging task. With the rise of pre-trained Large Language Models (LLMs), there is now an effective solution to store and use information extracted from massive corpora of text documents. Thus, we envision the use of SQL queries to cover a broad range of data that is not captured by traditional databases by tapping the information in LLMs. To ground this vision, we present Galois, a prototype based on a traditional database architecture, but with new physical operators for querying the underlying LLM. The main idea is to execute some operators of the the query plan with prompts that retrieve data from the LLM. For a large class of SQL queries, querying LLMs returns well structured relations, with encouraging qualitative results. Preliminary experimental results make pre-trained LLMs a promising addition to the field of database systems, introducing a new direction for hybrid query processing. However, we pinpoint several research challenges that must be addressed to build a DBMS that exploits LLMs. While some of these challenges necessitate integrating concepts from the NLP literature, others offer novel research avenues for the DB community.
Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 30 of its 62 references that are in the map. First posted on arXiv 2 Apr 2023.
Builds on
30 of 62 references.
References · 30
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
- 2022Survey of Hallucination in Natural Language Generationcited by 2,056
- 2019Language Models as Knowledge Bases?cited by 1,922
- 2022Solving Quantitative Reasoning Problems with Language Modelscited by 1,359
- 2021Improving language models by retrieving from trillions of tokenscited by 1,278
18 more
- 2018Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Taskcited by 1,120
- 2020Beyond Accuracy: Behavioral Testing of NLP models with CheckListcited by 979
- 2022Mass-Editing Memory in a Transformercited by 976
- 2023BloombergGPT: A Large Language Model for Financecited by 923
- 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 713
- 2021Editing Factual Knowledge in Language Modelscited by 548
- 2020TAPAS: Weakly Supervised Table Parsing via Pre-trainingcited by 432
- 2021Measuring and Improving Consistency in Pretrained Language Modelscited by 361
- 2023Check Your Facts and Try Again: Improving Large Language Models with External Knowledge and Automated Feedbackcited by 351
- 2022Demonstrate-Search-Predict: Composing retrieval and language models for knowledge-intensive NLPcited by 316
- 2021Factual Probing Is [MASK]: Learning vs. Learning to Recallcited by 291
- 2021Mind the Gap: Assessing Temporal Generalization in Neural Language Modelscited by 226
- 2022Can Foundation Models Wrangle Your Data?cited by 173
- 2020Break It Down: A Question Understanding Benchmarkcited by 131
- 2022Attributed Question Answering: Evaluation and Modeling for Attributed Large Language Modelscited by 108
- 2017Cross-Sentence N-ary Relation Extraction with Graph LSTMscited by 101
- 2021QA Dataset Explosion: A Taxonomy of NLP Resources for Question Answering and Reading Comprehensioncited by 91
- 2022Evaluating the Factual Consistency of Large Language Models Through News Summarizationcited by 90
Built on by
Citing papers per year: 2023: 4; 2024: 4; 2025: 4; 2026: 1.
13 papers.
Sort:
By area:
- 2024UQE: A Query Engine for Unstructured Databasescited by 18
- 2024Research Trends for the Interplay between Large Language Models and Knowledge Graphscited by 14
- 2024Hybrid Querying Over Relational Databases and Large Language Modelscited by 3
- 2025Large Language Models for Predictive Analysis: How Far Are They?cited by 3
- 2023Unstructured and structured data: Can we have the best of both worlds with large language models?cited by 2
- 2023When Giant Language Brains Just Aren't Enough! Domain Pizzazz with Knowledge Sparkle Dustcited by 1
- 2023Towards Consistent Language Models Using Declarative Constraintscited by 1
- 2024Contrato360 2.0: A Document and Database-Driven Question-Answer System using Large Language Models and Agentscited by 1
- 2025Recursive Question Understanding for Complex Question Answering over Heterogeneous Personal Datacited by 1
- 2025Implementing Semantic Join Operators Efficientlycited by 1
- 2023Saturn Platform: Foundation Model Operations and Generative AI for Financial Servicescited by 0
- 2025RelationalFactQA: A Benchmark for Evaluating Tabular Fact Retrieval from Large Language Modelscited by 0
- 2026Opti-Q: A Constraint-Based Optimization Framework for Multi-LLM Question Planning17 Jun 2026
- 2025Implementing Semantic Join Operators Efficiently9 Oct 2025
- 2025RelationalFactQA: A Benchmark for Evaluating Tabular Fact Retrieval from Large Language Models27 May 2025
- 2025Large Language Models for Predictive Analysis: How Far Are They?22 May 2025
- 2025Recursive Question Understanding for Complex Question Answering over Heterogeneous Personal Data17 May 2025
- 2024Contrato360 2.0: A Document and Database-Driven Question-Answer System using Large Language Models and Agents23 Dec 2024
- 2024Hybrid Querying Over Relational Databases and Large Language Models1 Aug 2024
- 2024UQE: A Query Engine for Unstructured Databases23 Jun 2024
- 2024Research Trends for the Interplay between Large Language Models and Knowledge Graphs12 Jun 2024
- 2023Towards Consistent Language Models Using Declarative Constraints24 Dec 2023
- 2023Saturn Platform: Foundation Model Operations and Generative AI for Financial Services12 Dec 2023
- 2023When Giant Language Brains Just Aren't Enough! Domain Pizzazz with Knowledge Sparkle Dust12 May 2023
- 2024UQE: A Query Engine for Unstructured Databasescited by 18
- 2024Research Trends for the Interplay between Large Language Models and Knowledge Graphscited by 14
- 2024Hybrid Querying Over Relational Databases and Large Language Modelscited by 3
- 2025Large Language Models for Predictive Analysis: How Far Are They?cited by 3
- 2023Unstructured and structured data: Can we have the best of both worlds with large language models?cited by 2
- 2023When Giant Language Brains Just Aren't Enough! Domain Pizzazz with Knowledge Sparkle Dustcited by 1
- 2023Towards Consistent Language Models Using Declarative Constraintscited by 1
- 2025Recursive Question Understanding for Complex Question Answering over Heterogeneous Personal Datacited by 1
- 2025Implementing Semantic Join Operators Efficientlycited by 1
- 2023Saturn Platform: Foundation Model Operations and Generative AI for Financial Servicescited by 0
- 2025RelationalFactQA: A Benchmark for Evaluating Tabular Fact Retrieval from Large Language Modelscited by 0
- 2026Opti-Q: A Constraint-Based Optimization Framework for Multi-LLM Question Planningcited by 0
- 2026Opti-Q: A Constraint-Based Optimization Framework for Multi-LLM Question Planning17 Jun 2026
- 2025Implementing Semantic Join Operators Efficiently9 Oct 2025
- 2025RelationalFactQA: A Benchmark for Evaluating Tabular Fact Retrieval from Large Language Models27 May 2025
- 2025Large Language Models for Predictive Analysis: How Far Are They?22 May 2025
- 2025Recursive Question Understanding for Complex Question Answering over Heterogeneous Personal Data17 May 2025
- 2024Hybrid Querying Over Relational Databases and Large Language Models1 Aug 2024
- 2024UQE: A Query Engine for Unstructured Databases23 Jun 2024
- 2024Research Trends for the Interplay between Large Language Models and Knowledge Graphs12 Jun 2024
- 2023Towards Consistent Language Models Using Declarative Constraints24 Dec 2023
- 2023Saturn Platform: Foundation Model Operations and Generative AI for Financial Services12 Dec 2023
- 2023When Giant Language Brains Just Aren't Enough! Domain Pizzazz with Knowledge Sparkle Dust12 May 2023
- 2023Unstructured and structured data: Can we have the best of both worlds with large language models?25 Apr 2023