Re: Storing query language in relations
Date: Tue, 24 Sep 2002 10:15:43 +0100
Message-ID: <ampb91$f3e$2_at_sp15at20.hursley.ibm.com>
> a relational database is the most logical way to
>hold structured data
I would rather say, 'the relational model is the most logical general way to structure and query persistent data'.
>why not go a step further and store the actual
>queries in relational format?
Also be careful with the word 'store'. To many it will suggests physical storage mechanisms. However, it is a good word, and I use it below but do not mean to imply anything about physical storage
>I know some DBMSs store the text of queries, view definitions,
>stored procedures etc. in tables but not in a normalised fashion.
>An advantage would be that the DB constraints would automatically
>validate the query so no need for parsing SQL code for syntax.
The downside being that you would need some horrendous multiple relvar assignments to enter a new query.
Having said that I think it would be a good test of a true relational
language. If such a language Type generator was provided, it would show
that they were eating their own food.
>Wasn't one of Codd's guidelines that metadata should also be
> stored relationally?
Indeed. I don't have the quote to hand, but the upshot is that EVERYTHING that is needed to be stored persistently, should be stored relationally.
>I know the table definitions (DDL)are
>in many DBMSs. But generally a separation is made between the
>database and its query language (DML).
>I've not thought too deeply about how a schema for SQL queries (for
>example) could be implemented but it must be possible (kind of like
>the MS Access query grid but normalised).
So the MS Access query grid can specify all possible relational expressions? Humm. As above, I would suggest using the grammar for the language as your schema. Nasty hey?
>Is this taking things too far or might this line of thinking
>produce something useful? Has this been done already in some
>DBMS?
As long as the ideas hold water, you have to go a long way to go to far in
a theory newsgroup.
:-)
Regards
Paul Vernon
Business Intelligence, IBM Global Services
Received on Tue Sep 24 2002 - 11:15:43 CEST
