Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are good alternatives to SQL (the language)? [closed]

Tags:

sql

database

I occasionally hear things about how SQL sucks and it's not a good language, but I never really hear much about alternatives to it. So, are other good languages that serve the same purpose (database access) and what makes them better than SQL? Are there any good databases that use this alternative language?

EDIT: I'm familiar with SQL and use it all the time. I don't have a problem with it, I'm just interested in any alternatives that might exist, and why people like them better.

I'm also not looking for alternative kinds of databases (the NoSQL movement), just different ways of accessing databases.

like image 346
Brendan Long Avatar asked Mar 23 '10 02:03

Brendan Long


People also ask

What is the alternative for SQL language?

Some of these alternative SQL query languages include: SchemeQL, CLSQL, ScalaQL and ScalaQuery for the Scheme and Scala dialects of Lisp, respectively. SQLStatement and ActiveRecord for Ruby. HaskellDB for Haskell.

Are there other database languages besides SQL?

MySQL, Oracle, PostgreSQL, Microsoft SQL Server, MongoDB, Redis, Elasticsearch, Cassandra, MariaDB, IBM Db2. Databases are the cornerstone of any Software Applications.

Can I use Python instead of SQL?

Python and SQL can perform some overlapping functions, but developers typically use SQL when working directly with databases and use Python for more general programming applications. Choosing which language to use depends on the query you need to complete.


2 Answers

I certainly agree that SQL's syntax is difficult to work with, both from the standpoint of automatically generating it, and from the standpoint of parsing it, and it's not the style of language we would write today if we were designing SQL for the demands we place on it today. I don't think we'd find so many varied keywords if we designed the language today, I suspect join syntax would be different, functions like GROUP_CONCAT would have more regular syntax rather than sticking more keywords in the middle of the parentheses to control its behavior... create your own laundry list of inconsistencies and redundancies in SQL that you'd like/expect to see smoothed out if we redesigned the language today.

There aren't any alternatives to SQL for speaking to relational databases (i.e. SQL as a protocol), but there are many alternatives to writing SQL in your applications. These alternatives have been implemented in the form of frontends for working with relational databases. Some examples of a frontend include:

  • SchemeQL and CLSQL, which are probably the most flexible, owing to their Lisp heritage, but they also look like a lot more like SQL than other frontends.
  • LINQ (in .Net)
  • ScalaQL and ScalaQuery (in Scala)
  • SqlStatement, ActiveRecord and many others in Ruby,
  • HaskellDB
  • ...the list goes on for many other languages.

I think that the underlying theme today is that rather than replace SQL with one new query language, we are instead creating language-specific frontends to hide the SQL in our regular every-day programming languages, and treating SQL as the protocol for talking to relational databases.

like image 74
Ken Bloom Avatar answered Oct 11 '22 23:10

Ken Bloom


Take a look at this list.

Hibernate Query Language is probably the most common. The advantage of Hibernate is that objects map very easily (nearly automatically) to the relational database, and the developer doesn't have to spend much time doing database design. Check out the Hibernate website for more info. I'm sure others will chime in with other interesting query languages...

Of course, there's plenty of NoSQL stuff out there, but you specifically mention that you're not interested in those.

like image 40
Mike Cialowicz Avatar answered Oct 11 '22 23:10

Mike Cialowicz