Remember to TRIM what you reply to!

begin  quoting Levi Smith as of Wed, Aug 17, 2005 at 01:30:53PM -0400:
> OK, I know I'm just asking for trouble here, but just for the sake of 
> argument, what if I did want to create a new compound key.  How would one do 
> that?  (preferably with phpmyadmin)

Don't know about phpmyadmin.

Something like

CREATE TABLE tablename ( 
   col1 INT        NOT NULL, 
   col2 VARCHAR(4) NOT NULL, 
   PRIMARY KEY ( col1, col2 )
   );

ought to do it.

>                                     Am I correct in thinking that a compound 
> key would be a sort of "virtual" key based on two columns that together make 
> them unique?

Yup.

[chop]

-Stewart "Trim, trim, trim, it keeps us all so slim..." Stremler

Attachment: pgpgCQUGjxaGG.pgp
Description: PGP signature

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to