Castle: Causal Cascade Updates in Relational Databases with Large Language Models

Yongye Su, Yucheng Zhang, Zeru Shi, Bruno Ribeiro, Elisa Bertino


Abstract
This work introduces Castle, the first framework for schema-only cascade update generation using large language models (LLMs). Despite recent advances in LLMs for Text2SQL code generation, existing approaches focus primarily on SELECT queries, neglecting the challenges of SQL update operations and their ripple effects. Traditional CASCADE UPDATE constraints are static and unsuitable for modern, denormalized databases, which demand dynamic, context-aware updates. Castle enables natural language instructions to trigger multi-column, causally consistent SQL UPDATE statements, without revealing table content to the model. By framing UPDATE SQL generation as a divide-and-conquer task with LLMs’ reasoning capacity, Castle can determine not only which columns must be directly updated, but also how those updates propagate through the schema, causing cascading updates — all via nested queries and substructures that ensure data confidentiality. We evaluate it on real-world causal update scenarios, demonstrating its ability to produce accurate SQL updates, and thereby highlighting the reasoning ability of LLMs in automated DBMS.
Anthology ID:
2025.emnlp-main.1700
Volume:
Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing
Month:
November
Year:
2025
Address:
Suzhou, China
Editors:
Christos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, Violet Peng
Venue:
EMNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
33501–33513
Language:
URL:
https://preview.aclanthology.org/ingest-emnlp/2025.emnlp-main.1700/
DOI:
Bibkey:
Cite (ACL):
Yongye Su, Yucheng Zhang, Zeru Shi, Bruno Ribeiro, and Elisa Bertino. 2025. Castle: Causal Cascade Updates in Relational Databases with Large Language Models. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 33501–33513, Suzhou, China. Association for Computational Linguistics.
Cite (Informal):
Castle: Causal Cascade Updates in Relational Databases with Large Language Models (Su et al., EMNLP 2025)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-emnlp/2025.emnlp-main.1700.pdf
Checklist:
 2025.emnlp-main.1700.checklist.pdf