I just came across HTSQL, which reminded me of a question I've wondered: what alternative declarative query languages for relational databases are out there? For all the complaints that exist against SQL, I'd expect many, but Googling has been unfruitful.
Various programming languages have list/monad comprehensions, but I'm looking more specifically for something with an actual implementation for relational databases. It would also be great to highlight their major differences vs. SQL (readability, modularity, concision, etc.). The implementation also needs to be open-source, and ideally something I can actually use against an existing RDBMS, e.g. Postgresql.
Here's my complete list, with links to illustrative example code (moved examples originally in my question down here):
Muldis D: Terse Perl-inspired syntax; designed to be a practical full scripting language.
HTSQL: Very terse; optimized for foreign key joins; somewhat limited expressiveness.
MDX:
The MultiDimensional eXpressions (MDX) language provides a specialized syntax for querying and manipulating the multidimensional data stored in OLAP cubes.[1] While it is possible to translate some of these into traditional SQL, it would frequently require the synthesis of clumsy SQL expressions even for very simple MDX expressions. MDX has been embraced by a wide majority of OLAP vendors and has become the de facto standard for OLAP systems.
I think of it as Pivot Tables over RDBMSs. Pushed by MS (not sure if it's still being pushed - seems old now). Pentaho Mondrian is an implementation that works with any JDBC provider.
PIQL: the "performance-predictable" language subset of SQL; designed for transaction processing; almost left this out till I noticed a Rails implementation, though it doesn't look complete so I may remove this
Pig: marriage of SQL, an imperative style, and a nested data model; due to the nature of the underlying processing framework (Map-Reduce/Hadoop), limited to equijoins; not really for relational databases, so I should remove this :)
LINQ to SQL (this doesn't really count, as it's mostly an embedded SQL, but what the hell): IMO more natural syntax ordering than SQL; also supports a nested data model
Example list of Query Languages available curtesy Wikipedia:
http://en.wikipedia.org/wiki/Query_language
Although not all these are for relational databases.
I'll list QUEL, which was stomped out by SQL but is still in use with the Ingres DBMS. Wikipedia says that it is more "normalized" than SQL, but a citation is needed. ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With