3 ms·
I've sometimes toyed with the idea that users of SQL would benefit from having a block-like representation of the language: there are big multi-clause statement
by radiowave 12y ago
I've sometimes toyed with the idea that users of SQL would benefit from having a block-like representation of the language: there are big multi-clause statements (particularly "SELECT ...", with lots of different places where values need to be plugged in, and a classic source of difficulty for novice/intermediate users is to know what kind of values can be used where, e.g. if you produce a value in the SELECT clause, you can't refer to it by name in a WHERE clause, but you can refer to it by name in ORDER BY. Another is that there's a less than obvious relationship between the GROUP BY clause and the SELECT clause.
A well-designed block language could offer a lot of guidance on these sort of points, perhaps by having a context-dependent pool of available blocks to drag into the body of the query.
At least, doing that would make more sense to me than any graphical query builder I've ever seen, with the bonus that it might lead to users who are more capable of writing SQL directly. (Not that I'm holding up SQL as a paragon of language design - but it is ubiquitous, and very useful in a wide range of situations.)
- batbomb 12y agoYou can use WITH statements/Common table expressions.
- bunderbunder 12y agoSadly, knowledge of CTEs seems to be poorly disseminated. I suspect it's because, at least as of last time I bothered to check, they still aren't supported in MySQL. Come to it, I've got similar suspicions around overcomplicated query structures and MySQL's lack of hash joins.
- acbart 12y agoBags: http://bags.cs.jmu.edu/ http://bags.cs.jmu.edu/ DBSnap: http://www.public.asu.edu/~ynsilva/dbsnap/ http://www.public.asu.edu/~ynsilva/dbsnap/ DataSnap: http://think.cs.vt.edu/snap/ http://think.cs.vt.edu/snap/
- radiowave 12y agoFantastic! Thanks, I'll check those out.