Re: Creating a table with two keys?

From: ME <74577.1525_at_CompuServe.COM>
Date: 1996/10/29
Message-ID: <555lr0$6km$1_at_mhadf.production.compuserve.com>#1/1


In article <3272A6FE.482D_at_tam2000.tamu.edu>, bem6681_at_tam2000.tamu.edu wrote:  

> I know this is probably a simple question, but how do I create a table
> with two primary keys? Here is what I tried, but it doesn't work:
>
> create table class
> (
> semester_code char(3) not null primary key,
> course_num smallint not null primary key,
> hours float not null
> )
>
> Thanks for any help,
>
> Brian Master

Try this Brian,

create table TEST
(

   semester_code char(3) not null,
    course_num smallint not null,
    hours float,
    constraint pk_test primary key (semester_code,course_num) );
I believe this will get you what you wish..

Robert Received on Tue Oct 29 1996 - 00:00:00 CET

Original text of this message