SQL language drawbacks, The Third Manifesto
Posted
by
David Portabella
on Programmers
See other posts from Programmers
or by David Portabella
Published on 2012-06-04T13:29:28Z
Indexed on
2012/06/04
16:54 UTC
Read the original article
Hit count: 240
sql
|relational-database
Sometime ago I read about SQL language drawbacks (the basic language specification, not vendor specific),
and one of the drawbacks was that the language does not allow to create a set of tuples that don't come from a table.
For instance,
SELECT firstName, lastName from people;
this creates a set of tuples coming from the table people
.
Now, if I don't have this table people
, and I want to return a constant, I'd need something like this to return a set of two tuples (this would not require to have a table):
SELECT VALUES('james', 'dean'), ('tom', 'cruisse');
Why I would need that?
Because of the same reasons that we can define constants (not only basic types, but objects and arrays also) in any advanced programming language.
Workarounds,
Yes, I could create a temporal table, fill the data, and SELECT from that table.
This is a hack, to overcome the drawbacks of the poor SQL language.
I think that I read about this somewhere in "The Third Manifesto",
but I don't find the paragraph/example talking about this concrete drawback anymore.
Do you know a reference about it?
© Programmers or respective owner