A Conversation for The H2G2 Programmers' Corner

how bad is SQL?

Post 21

MaW

And Boyce-Codd Normal Form is really, really silly. 3NF is practical (most of my stuff ends up in 3NF after about the first phase of table design, I don't even have to think about it), but Boyce-Codd? Please no.

I do some fairly complex things in SQL. The worst problem I have is running into MySQL's limitations, not those of SQL itself. MySQL, for example, does not currently support subqueries, and in the forum-based site I'm finishing off at the moment, there are a number of times that subqueries would have enabled me to avoid doing icky things like write-locking multiple tables (although happily that code doesn't actually get executed very often).

MySQL 4.1 or so should have subquery support though - although I've not checked up on that recently.


how bad is SQL?

Post 22

Pastey

Using SQL through PHP I've found MSSQL a lot more limiting than MySQL, so I think you'd probably freak at that!smiley - laugh

smiley - rose


how bad is SQL?

Post 23

MaW

I'm not surprised. I'm glad I don't have to do that...


how bad is SQL?

Post 24

xyroth

of course the main problem with sql is that it takes a simple idea like relational algebra or relational calculus, and criples it with an excess method which is ridiculously limited in what it can do.

The main reason for using relational databases is that you can make arbitrary queries on them. once you have to go through sql, this is no longer true, as the data model has to be set up to aid the queries.

this strikes me as bizzare.


how bad is SQL?

Post 25

MaW

So how would you implement in a practical manner a language which allows truly abitrary queries using relational algebra?

And I've never run into any problems of that line, by the way.


how bad is SQL?

Post 26

Ausnahmsweise, wie üblich (Consistently inconsistent)

Yes - Xyroth,
please explain with an example how you would implement the access (I think you meant access not excess) method you envisage.

A data base designer might set up the data base with the efficiency of some queries in mind, but I don't think it's true to say that you have to set up the data model to aid the queries.

Awu
I just noticed that MaW::[guru] is BNF style syntax


how bad is SQL?

Post 27

MaW

Actually, MaW :: [guru] -> (whatever) is supposed to be a Haskell type definition, meaning

'MaW is a thing of type (list of guru) which becomes type (whatever)'

And thus that MaW is a function taking one parameter.


how bad is SQL?

Post 28

xyroth

no, I did mean an excess method. sql, while an arbitrary and non-standard standard, is bolted on top of relational algebra.

in relational algebra, you really can do arbitrary queries of any well defined database.

from what I've seen and heard other saying, in SQL you don't just end up with the queries being slow, but with them being arbitrary as to if they will give sensible results when you use the same query on the same data in different systems.

this seems to be especially true with multipart multilevel queries, but is not restricted to just those queries.


Key: Complain about this post

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more