List:General Discussion« Previous MessageNext Message »
From:Caroline Jen Date:January 2 2004 6:43am
Subject:Primary Key
View as plain text  
I saw an example of creating tables (see below).  I
wonder what the primary key (user_name, role_name) in
the table user_roles means?  Does it mean that both
user_name and role_name are the primary key of the
user_roles table?  How does a table have two primary
keys?

create table users (
  user_name         varchar(15) not null primary key,
  user_pass         varchar(15) not null
);

create table user_roles (
  user_name         varchar(15) not null,
  role_name         varchar(15) not null,
  primary key (user_name, role_name)
);

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
Thread
Primary KeyCaroline Jen2 Jan
  • Re: Primary KeyMartijn Tonies2 Jan