Formalizing a Broader Recursion Coverage in SQL
SQL is the de facto standard language for relational databases and has evolved by introducing new resources and expressive capabilities, such as recursive definitions in queries and views. Recursion was included in the SQL-99 standard, but this approach is limited as only linear recursion is allowed, mutual recursion is not supported, and negation cannot be combined with recursion. In this work, we propose a new approach, called R-SQL, aimed to overcome these limitations and others, allowing in particular cycles in recursive definitions of graphs and mutually recursive relation definitions. In order to combine recursion and negation, we import ideas from the deductive database field, such as stratified negation, based on the definition of a dependency graph between relations involved in the database. We develop a formal framework using a stratified fixpoint semantics and introduce a proof-of-concept implementation.
KeywordsDatabases SQL Recursion Fixpoint Semantics
Unable to display preview. Download preview PDF.
- 1.Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley (1995)Google Scholar
- 3.Date, C.J.: SQL and relational theory: how to write accurate SQL code. O’Reilly, Sebastopol (2009)Google Scholar
- 4.Finkelstein, S.J., Mattos, N., Mumick, I.S., Pirahesh, H.: Expressing recursive queries in SQL. Technical report, ISO (1996)Google Scholar
- 5.Garcia-Molina, H., Ullman, J.D., Widom, J.: Database systems - the complete book, 2nd edn. Pearson Education (2009)Google Scholar
- 7.ISO/IEC. SQL: 2008 ISO/IEC 9075 (1-4,9-11,13,14): 2008 Standard (2008)Google Scholar
- 9.Kowalski, R.A.: Logic for data description. In: Logic and Data Bases, pp. 77–103 (1977)Google Scholar
- 13.Reiter, R.: Towards a logical reconstruction of relational database theory. In: On Conceptual Modelling (Intervale), pp. 191–233 (1982)Google Scholar
- 14.Shepherdson, J.: Negation in logic programming. In: Minker, J. (ed.) Foundations of Deductive Databases and Logic Programming, pp. 19–88. Kaufmann, Los Altos (1988)Google Scholar
- 16.Ullman, J.: Database and Knowledge-Base Systems, Vols. I (Classical Database Systems) and II (The New Technologies). Computer Science Press (1995)Google Scholar
- 17.Zaniolo, C., Ceri, S., Faloutsos, C., Snodgrass, R.T., Subrahmanian, V.S., Zicari, R.: Advanced Database Systems. Morgan Kaufmann Publishers Inc. (1997)Google Scholar