Re: how to set more than two attributes as primary keys in a table

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Peggy Go <shatz_go(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: how to set more than two attributes as primary keys in a table
Date: 2003-12-29 04:24:27
Message-ID: 20031229042427.GC4924@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sun, Dec 28, 2003 at 20:21:32 -0800,
Peggy Go <shatz_go(at)yahoo(dot)com> wrote:
> Hi!...
>
> Normally, there is only one attribute for the primary
> key but in my table, my primary key is composed of two
> attributes. How do I state this in SQL? What if
> Region_num and Num_Players, combined, should form a
> primary key?
>
CREATE TABLE REGION (
Region_Num smallint,
Num_Players smallint,
Player_Num smallint,
primary key (Region_Num, Num_Players)
);

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2003-12-29 04:30:45 Re: how to set more than two attributes as primary keys in a table
Previous Message Peggy Go 2003-12-29 04:21:32 how to set more than two attributes as primary keys in a table