Re: Database schemas

From: Laconic2 <laconic2_at_comcast.net>
Date: Sun, 5 Sep 2004 10:01:28 -0400
Message-ID: <v8Cdnbg8z4zCgabcRVn-sg_at_comcast.com>


"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. Received on Sun Sep 05 2004 - 16:01:28 CEST

Original text of this message