10

I am studying relational algebra these days and I was wondering...

Don't you thing it would be better if a compiler was existed which could compile relational algebra than compiling SQL?

In which case a database programmer would be more productive?

Is there any research on relational algebra compilers?

Thanks in advance

Novemberland
  • 530
  • 3
  • 8
  • 25

3 Answers3

5

See Tutorial D by C J Date, he also has a good rant somewhere on the evils of SQL.

Also see datalog, although not exactly relational algebra, is similar.

relet
  • 6,819
  • 2
  • 33
  • 41
deinst
  • 18,402
  • 3
  • 47
  • 45
  • I'm not at all sure what is going on. There appears to be a //tp being inserted. Look up Tutorial D on wikipedia. There is also an implementation of Tutorial D called rel. C J Date's rant is entitled "A critique of the SQL database language", but it is behind a paywall. If you are a student you should be able to get it. – deinst Aug 08 '10 at 13:24
  • I am not a student, I was refreshing relational algebra, I have written maany lines of SQL but reconsidered relational algebra as better than SQL. – Novemberland Aug 08 '10 at 13:27
  • Datalog is exactly relational algebra plus transitive closure. – John Cowan Oct 21 '19 at 23:50
3

On my school one student implemented relational algebra parser as a Bachelor thesis. You can test it here:
http://mufin.fi.muni.cz/projects/PA152/relalg/index.cgi

It's in czech language but I think you can get a point.

I tried to write some Relational Algebra queries and it was much better than equivalent queries in SQL! They were much shorter, simplier to write, more straightforward, more understandable. I really enjoyed to write them.

So I don't understand why we all are using SQL when there is Relational Algebra.

Ondrej Bozek
  • 10,987
  • 7
  • 54
  • 70
1

There is indeed research on compiling relational algebra

A good place to start: Thomas Neumann: Efficiently Compiling Efficient Query Plans for Modern Hardware. PVLDB 4(9): 539-550 (2011)

Bill Howe
  • 1
  • 1