The Script-Writer's Dream: How to Write Great SQL in Your Own Language, and Be Sure It Will Succeed

We show how to translate expressions in a higher-order programming language into SQL queries. Somewhat surprisingly, we show that any suitable expression translates to a single SQL query, where the suitability is determined by a type-and-effect check. Thus, unlike in Hollywood where a script-writer can never be sure a movie sequel will be popular, we show how to be sure that your SQL--written in your own language--will succeed (in being translated).

[1]  Limsoon Wong,et al.  Normal Forms and Conservative Extension Properties for Query Languages over Collection Types , 1996, J. Comput. Syst. Sci..

[2]  Torsten Grust,et al.  FERRY: database-supported program execution , 2009, SIGMOD Conference.

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

[4]  Leonidas Fegaras,et al.  Query unnesting in object-oriented databases , 1998, SIGMOD '98.

[5]  Pierre Jouvelot,et al.  The Type and Effect Discipline , 1994, Inf. Comput..

[6]  David Maier,et al.  Making smalltalk a database system , 1984, SIGMOD '84.

[7]  Alexandra Poulovassilis,et al.  The Functional Approach to Data Management , 2004, Springer Berlin Heidelberg.

[8]  Peter Buneman,et al.  Types and persistence in database programming languages , 1987, CSUR.

[9]  Patrick C. Fischer,et al.  Nested Relational Structures , 1986, Adv. Comput. Res..

[10]  Dirk Van Gucht,et al.  Converting nested algebra expressions into flat algebra expressions , 1992, TODS.

[11]  Sam Lindley,et al.  Extensional Rewriting with Sums , 2007, TLCA.

[12]  William R. Cook,et al.  Extracting queries by static analysis of transparent persistence , 2007, POPL '07.

[13]  Joachim Biskup,et al.  Database Theory — ICDT '92 , 1992, Lecture Notes in Computer Science.

[14]  Limsoon Wong,et al.  A Data Transformation System for Biological Data Sources , 1995, VLDB.

[15]  Ian Stark,et al.  Reducibility and TT-Lifting for Computation Types , 2005, TLCA.

[16]  Dan Suciu,et al.  Fixpoints and Bounded Fixpoints for Complex Objects , 1993 .

[17]  Dan Suciu,et al.  On Two Forms of Structural Recursion , 1995, ICDT.

[18]  Philip Wadler,et al.  List Comprehensions and the Relational Calculus , 1999 .

[19]  Limsoon Wong,et al.  Naturally Embedded Query Languages , 1992, ICDT.

[20]  Frank D. Valencia,et al.  Formal Methods for Components and Objects , 2002, Lecture Notes in Computer Science.

[21]  Hans-Jörg Schek,et al.  The relational model with relation-valued attributes , 1986, Inf. Syst..

[22]  Dan Suciu,et al.  Comprehension syntax , 1994, SGMD.

[23]  Georg Gottlob,et al.  Database Theory — ICDT '95 , 1995, Lecture Notes in Computer Science.

[24]  Torsten Grust,et al.  How to Comprehend Queries Functionally , 1999, Journal of Intelligent Information Systems.

[25]  Torsten Grust,et al.  Monad comprehensions : a versatile representation for queries , 2004 .

[26]  Philip Wadler,et al.  Links: Web Programming Without Tiers , 2006, FMCO.

[27]  Dan Suciu Bounded Fixpoints for Complex Objects , 1993 .

[28]  Dirk Van Gucht,et al.  Possibilities and limitations of using flat operators in nested algebra expressions , 1988, PODS '88.

[29]  S. Lindley Reducibility and > >-lifting for Computation Types , 2004 .

[30]  Philip W. Trinder,et al.  Comprehensions, a Query Notation for DBPLs , 1992, DBPL.

[31]  Jan Van den Bussche,et al.  Simulation of the nested relational algebra by the flat relational algebra, with an application to the complexity of evaluating powerset algebra expressions , 2001, Theor. Comput. Sci..