A crash course on database queries

Complex database queries, like programs in general, can "crash", i.e., can raise runtime errors. We want to avoid crashes without losing expressive power, or we want to correctly predict the absence of crashes. We show how concepts and techniques from programming language theory, notably type systems and reflection, can be adaptedto this end. Of course, the specific nature of database queries (asopposed to general programs), also requires some new methods, andraises new questions.

[1]  Giuseppe Castagna,et al.  CDuce: an XML-centric general-purpose language , 2003, ICFP '03.

[2]  Stijn Vansummeren,et al.  On the complexity of deciding typability in the relational algebra , 2005, Acta Informatica.

[3]  R. G. G. Cattell,et al.  Recent books , 2000, IEEE Spectrum.

[4]  Laks V. S. Lakshmanan,et al.  A Foundation for Multi-dimensional Databases , 1997, VLDB.

[5]  Cong Yu,et al.  XQuery 1.0 and XPath 2.0 Full-Text , 2009, Encyclopedia of Database Systems.

[6]  Michael Stonebraker,et al.  QUEL as a data type , 1984, SIGMOD '84.

[7]  Luca Cardelli,et al.  The Computer Science and Engineering Handbook , 1997 .

[8]  Peter Buneman,et al.  Polymorphism and type inference in database programming , 1996, TODS.

[9]  Peter Buneman,et al.  Theoretical Aspects of Object-Oriented Programming , 1994 .

[10]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[11]  Luca Cardelli Type systems , 1996, CSUR.

[12]  Benjamin C. Pierce,et al.  XDuce: A statically typed XML processing language , 2003, TOIT.

[13]  Laks V. S. Lakshmanan,et al.  SchemaSQL: An extension to SQL for multidatabase interoperability , 2001, ACM Trans. Database Syst..

[14]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[15]  Helmut Seidl,et al.  XML type checking with macro tree transducers , 2005, PODS.

[16]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[17]  Edward L. Robertson,et al.  Relational languages for metadata integration , 2005, TODS.

[18]  Gottfried Vossen,et al.  Typed Query Languages for Databases Containing Queries , 1999, Inf. Syst..

[19]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[20]  H. Schwichtenberg,et al.  Definierbare Funktionen im Lambda-Kalkül mit Typen , 1976 .

[21]  Jan Van den Bussche,et al.  Polymorphic type inference for the named nested relational calculus , 2007, TOCL.

[22]  Walid Taha,et al.  MetaML and multi-stage programming with explicit annotations , 2000, Theor. Comput. Sci..

[23]  Didier Rémy,et al.  Type inference for records in natural extension of ML , 1994 .

[24]  Frank Neven,et al.  On the complexity of typechecking top-down XML transformations , 2005, Theor. Comput. Sci..

[25]  Scott Boag,et al.  XQuery 1.0 : An XML Query Language , 2007 .

[26]  Bingsheng He,et al.  A Quantitative Summary of XML Structures , 2006, ER.

[27]  Gottfried Vossen,et al.  Meta-SQL: Towards Practical Meta-Querying , 2004, EDBT.

[28]  Gottfried Vossen,et al.  Towards practical meta-querying , 2002, Inf. Syst..

[29]  Dan Suciu,et al.  Adding Structure to Unstructured Data , 1997, ICDT.

[30]  Serge Abiteboul,et al.  Foundations of Databases , 1994 .

[31]  Michael Kifer,et al.  HILOG: A Foundation for Higher-Order Logic Programming , 1993, J. Log. Program..

[32]  Benjamin C. Pierce,et al.  Regular expression types for XML , 2005, ACM Trans. Program. Lang. Syst..

[33]  Dan Suciu,et al.  Typechecking for XML transformers , 2000, PODS '00.

[34]  Gottfried Vossen,et al.  Reflective Programming in the Relational Algebra , 1996, J. Comput. Syst. Sci..

[35]  Christoph Koch,et al.  On the complexity of nonrecursive XQuery and functional query languages on complex values , 2006, TODS.

[36]  P. Hudak,et al.  A general framework for hindley/milner type systems with constraints , 2000 .

[37]  Limsoon Wong,et al.  Principles of Programming with Complex Objects and Collection Types , 1995, Theor. Comput. Sci..

[38]  Dieter Gawlick,et al.  Applications for expression data in relational database systems , 2004, Proceedings. 20th International Conference on Data Engineering.

[39]  Martin Sulzmann A General Type Inference Framework for Hindley/Milner Style Systems , 2001, FLOPS.

[40]  Jan Van den Bussche,et al.  Polymorphic Type Inference for the Relational Algebra , 2001, J. Comput. Syst. Sci..

[41]  S. Boag,et al.  XQuery 1.0 : An XML query language, W3C Working Draft 12 November 2003 , 2003 .

[42]  Frank Neven,et al.  Frontiers of tractability for typechecking simple XML transformations , 2007, J. Comput. Syst. Sci..

[43]  Kenneth A. Ross Relations with relation names as arguments: algebra and calculus , 1992, PODS '92.

[44]  Limsoon Wong,et al.  Kleisli, a functional query system , 2000, J. Funct. Program..

[45]  Noga Alon,et al.  XML with data values: typechecking revisited , 2003, J. Comput. Syst. Sci..

[46]  Dirk Van Gucht,et al.  A Uniform Data Model for Relational Data and Meta-Data Query Processing , 1995, COMAD.

[47]  Dan Suciu Typechecking for Semistructured Data , 2001, DBPL.

[48]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[49]  Michael Stonebraker,et al.  Extending a database system with procedures , 1987, TODS.

[50]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[51]  Atsushi Ohori,et al.  A polymorphic record calculus and its compilation , 1995, TOPL.

[52]  Wolfgang Thomas,et al.  Languages, Automata, and Logic , 1997, Handbook of Formal Languages.

[53]  Gottfried Vossen,et al.  Typed query languages for databases containing queries , 1998, Inf. Syst..

[54]  Moshe Y. Vardi The complexity of relational query languages (Extended Abstract) , 1982, STOC '82.

[55]  Giuseppe Castagna,et al.  CDuce: an XML-centric general-purpose language , 2003, ACM SIGPLAN Notices.

[56]  Stijn Vansummeren,et al.  On deciding well-definedness for query languages on trees , 2007, JACM.

[57]  Jennifer Widom,et al.  The Lowell database research self-assessment , 2003, CACM.

[58]  Roy Goldman,et al.  DataGuides: Enabling Query Formulation and Optimization in Semistructured Databases , 1997, VLDB.

[59]  Thomas Schwentick,et al.  Database Theory - ICDT 2007, 11th International Conference, Barcelona, Spain, January 10-12, 2007, Proceedings , 2007, ICDT.

[60]  John C. Mitchell,et al.  Theoretical aspects of object-oriented programming: types, semantics, and language design , 1994, Choice Reviews Online.

[61]  Helmut Seidl,et al.  Exact XML Type Checking in Polynomial Time , 2007, ICDT.

[62]  Tim Sheard,et al.  Closed types for a safe imperative MetaML , 2003, J. Funct. Program..

[63]  Mitchell Wand,et al.  Type inference for record concatenation and multiple inheritance , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[64]  Stijn Vansummeren,et al.  Deciding well-definedness of XQuery fragments , 2005, PODS.

[65]  Jim Melton Understanding SQL Stored Procedures: A Complete Guide to SQL/PSM , 1998 .

[66]  Piotr Wieczorek Complexity of Typechecking XML Views of Relational Databases , 2007, ICDT.

[67]  Noga Alon,et al.  Typechecking XML views of relational databases , 2001, Proceedings 16th Annual IEEE Symposium on Logic in Computer Science.

[68]  Jan Van den Bussche,et al.  Well-definedness and semantic type-checking for the nested relational calculus , 2007, Theor. Comput. Sci..