Re: Database schemas

From: James <nospam_at_nospam.com>
Date: Sun, 5 Sep 2004 15:08:21 +0000 (UTC)
Message-ID: <znsz60b1usqr$.ymccbnqkfau8$.dlg_at_40tude.net>


On Sun, 5 Sep 2004 10:01:28 -0400, Laconic2 wrote:

> "James" <nospam_at_nospam.com> wrote in message
> news:8kffd8soofkc.sjhea8mjpwic$.dlg_at_40tude.net...

>> Hi,
>>
>> I am a programmer who wants to understand more about databases.  I believe
>> I understand the basics ie Tables, relationships, keys, at least to a
>> certain extent.
>>
>> But my understanding of schema is limited.  I just want to know where a
>> schema fits in when creating databases, more a practical point of view, is
>> it something only the DBA uses?, what's its purpose etc  An overview more
>> than anything so I can look into more detail if needed.  I've read a

> number
>> of descriptions on the web but I am not satisfied, as they go into details
>> that i do not have a handle on such as conceptual, internal, external
>> models...this is too much straight off, I need the basics more a starting
>> point.
>>
>> Thanks

>
> I'd like to explain schemas to you by comparing them to something you
> already know. My comparison is likely to be sloppy and informal, and to be
> bashed by the local equivalent of the Spanish inquisition. But I don't know
> what you already know.
>
> Have you ever used libraries of record definitions in order to avoid hard
> coding record defs into the data division of a COBOL program? When the
> COBOL compiler processes the program, it validates and expands library
> references with "the real thing" by consulting the library.
>
> Now consider an SQL compiler (or a precompiler) processing the following.
>
> SELECT column FROM table into :variable WHERE predicate;
>
> The compiler is going to validate and substitute "column" and "table" by
> referencing some catalog where these are defined.
> It's going to use the schema. That's one reason the schema is there.
>
> The compiler is also going to validate "variable", but it will do it by
> referencing the compiler's internal symbol table. If variable has been
> defined elsewhere in the same program, the compiler will have picked up the
> definition and put it in it's symbol table.
>
> There are lots of other uses for the schema. This is only one of them.
>
> Maybe you want to separate your question into two questions. Who reads from
> the schema? and who writes to it?
> I'm only guessing at what you are looking for.

Thanks for the explanation, from what you say it seems a schema is something internal to a database, not like a table or a relation that you can just edit. Have I got the wrong end of the stick here? I know that you can tweak databases ie change their internal data structures using SQL ie change from B-tree to Isam or something else...if I was creating a database tomorrow, would I care about the schema? Received on Sun Sep 05 2004 - 17:08:21 CEST

Original text of this message