Abstract
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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley (1995)
Codd, E.: A Relational Model for Large Shared Databanks. Communications of the ACM 13(6), 377–390 (1970)
Date, C.J.: SQL and relational theory: how to write accurate SQL code. O’Reilly, Sebastopol (2009)
Finkelstein, S.J., Mattos, N., Mumick, I.S., Pirahesh, H.: Expressing recursive queries in SQL. Technical report, ISO (1996)
Garcia-Molina, H., Ullman, J.D., Widom, J.: Database systems - the complete book, 2nd edn. Pearson Education (2009)
Houtsma, M.A.W., Apers, P.M.G.: Algebraic optimization of recursive queries. Data Knowl. Eng. 7, 299–325 (1991)
ISO/IEC. SQL: 2008 ISO/IEC 9075 (1-4,9-11,13,14): 2008 Standard (2008)
Kaser, O., Ramakrishnan, C.R., Pawagi, S.: On the conversion of indirect to direct recursion. ACM Lett. Program. Lang. Syst. 2(1-4), 151–164 (1993)
Kowalski, R.A.: Logic for data description. In: Logic and Data Bases, pp. 77–103 (1977)
Mumick, I.S., Pirahesh, H.: Implementation of magic-sets in a relational database system. SIGMOD Rec. 23, 103–114 (1994)
Nieva, S., Sánchez-Hernández, J., Sáenz-Pérez, F.: Formalizing a Constraint Deductive Database Language based on Hereditary Harrop Formulas with Negation. In: Garrigue, J., Hermenegildo, M.V. (eds.) FLOPS 2008. LNCS, vol. 4989, pp. 289–304. Springer, Heidelberg (2008)
Ramamohanarao, K., Harland, J.: An introduction to deductive database languages and systems. The VLDB Journal 3(2), 107–122 (1994)
Reiter, R.: Towards a logical reconstruction of relational database theory. In: On Conceptual Modelling (Intervale), pp. 191–233 (1982)
Shepherdson, J.: Negation in logic programming. In: Minker, J. (ed.) Foundations of Deductive Databases and Logic Programming, pp. 19–88. Kaufmann, Los Altos (1988)
Tarski, A.: A lattice-theoretical fixpoint theorem and its applications. Pacific Journal of Mathematics 5, 285–309 (1955)
Ullman, J.: Database and Knowledge-Base Systems, Vols. I (Classical Database Systems) and II (The New Technologies). Computer Science Press (1995)
Zaniolo, C., Ceri, S., Faloutsos, C., Snodgrass, R.T., Subrahmanian, V.S., Zicari, R.: Advanced Database Systems. Morgan Kaufmann Publishers Inc. (1997)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Aranda, G., Nieva, S., Sáenz-Pérez, F., Sánchez-Hernández, J. (2013). Formalizing a Broader Recursion Coverage in SQL. In: Sagonas, K. (eds) Practical Aspects of Declarative Languages. PADL 2013. Lecture Notes in Computer Science, vol 7752. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-45284-0_7
Download citation
DOI: https://doi.org/10.1007/978-3-642-45284-0_7
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-45283-3
Online ISBN: 978-3-642-45284-0
eBook Packages: Computer ScienceComputer Science (R0)