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: Arthur <mechhunter_at_rocketmail.com>
Date: Fri, 29 Sep 2000 09:48:29 GMT
Message-ID: <39d463a5.16065542@news.iinet.net.au>

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 Fri Sep 29 2000 - 04:48:29 CDT

Original text of this message

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