Skip to main content

Formalizing a Broader Recursion Coverage in SQL

  • Conference paper
Practical Aspects of Declarative Languages (PADL 2013)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7752))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Abiteboul, S., Hull, R., Vianu, V.: Foundations of Databases. Addison-Wesley (1995)

    Google Scholar 

  2. Codd, E.: A Relational Model for Large Shared Databanks. Communications of the ACM 13(6), 377–390 (1970)

    Article  MATH  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 

  6. Houtsma, M.A.W., Apers, P.M.G.: Algebraic optimization of recursive queries. Data Knowl. Eng. 7, 299–325 (1991)

    Article  Google Scholar 

  7. ISO/IEC. SQL: 2008 ISO/IEC 9075 (1-4,9-11,13,14): 2008 Standard (2008)

    Google Scholar 

  8. 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)

    Article  Google Scholar 

  9. Kowalski, R.A.: Logic for data description. In: Logic and Data Bases, pp. 77–103 (1977)

    Google Scholar 

  10. Mumick, I.S., Pirahesh, H.: Implementation of magic-sets in a relational database system. SIGMOD Rec. 23, 103–114 (1994)

    Article  Google Scholar 

  11. 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)

    Chapter  Google Scholar 

  12. Ramamohanarao, K., Harland, J.: An introduction to deductive database languages and systems. The VLDB Journal 3(2), 107–122 (1994)

    Article  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 

  15. Tarski, A.: A lattice-theoretical fixpoint theorem and its applications. Pacific Journal of Mathematics 5, 285–309 (1955)

    Article  MathSciNet  MATH  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 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics