Your example has 1 Primary Key and 2 Foreign Keys. 

Please post a sample data structure and state (not in SQL) what situation 
you want to achieve.  If you need more constraints on the table to prevent 
creating duplicates you can create additional UNIQUE Keys but, by 
definition, any table should have only one Primary Key.

Yours,

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

"Rui Monteiro" <[EMAIL PROTECTED]> wrote on 07/20/2004 11:54:00 AM:

> Mello,
> 
> 
> 
> I was wondering why canto r how can I put 2 primary keys on a table?
> 
> 
> 
> Here's na example on Oracle language:
> 
> 
> 
> CREATE TABLE FacturaMusica(
> 
>             CodFactura number(4), CONSTRAINTS 
FK_FacturaMusica_CodFactura
> FOREIGN KEY(CodFactura) REFERENCES Factura(CodFactura),
> 
>             CodMusica number(4), CONSTRAINTS FK_FacturaMusica_CodMusica
> FOREIGN KEY(CodMusica) REFERENCES Musica(CodMusica),
> 
>             CONSTRAINT PK_FacturaMusica PRIMARY 
KEY(CodFactura,CodMusica)
> 
> );
> 
> 
> 
> This is very usefull to break "n" to "n" relations.
> 
> 
> 
> Any tip?
> 
> 
> 
> Thanks
> 
> 
> 
> Rui
> 

Reply via email to