| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: O'Reilly interview with Date
Paul wrote:
>> In my own system I never manually code a join, I just specify the two >> tables and it builds it out of the foreign key definitions.
personally i distinguish them with a prefix code, which is put onto the end of the column(s) names.
So let's say I was cross-referencing a table to itself. In Andromeda notation we'd have something like this:
column SOMECOLUMN { description: Nada; type_id: int; }
table EXAMPLES {
column SOMECOLUMN { primary_key: Y; }
}
and then x-ref table:
table EXAMPLES_XREF {
foreign_key EXAMPLES;
foreign_key EXMAPLES { suffix: _to; }
}
which is equivalent to the following DDL:
create table examples (
SOMECOLUMN int PRIMARY KEY
)
create table examples_xref (
SOMECOLUMN int REFERENCES examples(SOMECOLUMN),
SOMECOLUMN_TO int REFERENCES examples(SOMECOLUMN)
)
My DDL may be rusty because i wrote a program to do it for me and I don't do DDL anymore.
-- Kenneth Downs Secure Data Software, Inc. (Ken)nneth@(Sec)ure(Dat)a(.com)Received on Wed Aug 10 2005 - 16:18:16 CDT
![]() |
![]() |