Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: multiple primary keys

Re: multiple primary keys

From: Avi Abrami <aabrami_at_intersystemsww.com>
Date: Mon, 02 Oct 2000 08:08:06 +0200
Message-ID: <39D82646.39E7B2B9@intersystemsww.com>

I think NightWing means a primary key composed of three columns of the table. In any case, if NightWing is using Oracle, the information he seeks is available via the following URL:     http://technet.oracle.com

All the Oracle documentation is available. The SQL syntax guide explains how to write SQL to create a table and how to define its primary key.

HTH,
Avi.

Arthur wrote:

> Hi,
>
> I am only new to this but I don't think that you can have more than
> one primary key per table. In many ways, primary keys are similiar
> to unique key - although I have yet to know what the main difference
> between they are.
>
> Anyway, after all that - to create primary key on a table, you do :
>
> CREATE TABLE table_name(
> column_1A varchar2,
> column_2A varchar2,
> CONSTRAINT table_name_pk PRIMARY KEY(column_1A));
>
> For have another table reference to the above tables Primary key as a
> foreign key,
>
> CREATE TABLE table_2(
> column_1B varchar2,
> column_2B varchar2,
> CONSTRAINT table_2_fk FOREIGN KEY(column_1B)
> REFERENCES table_name(column_1A));
>
> On Fri, 29 Sep 2000 11:22:05 +0200, NightWing <NightWing_at_wanadoo.nl>
> wrote:
>
> >I'm a newbie, and I need some help with this:
> >Can someone give me the SQL creationscript to make a the following two
> >tables:
> >A table that has 3 primary keys.
> >A table that refers to the table containing containing the 3 primary
> >keys.
> >
> >I can fill in the datatypes myself. I just need to know how to make
> >the above construction.
> >
> >NightWing
> >(-=\V/=-)
Received on Mon Oct 02 2000 - 01:08:06 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US