Computing.Net > Forums > Programming > MYSQL Question

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

MYSQL Question

Reply to Message Icon

Name: Nirav
Date: October 29, 2002 at 19:48:08 Pacific
OS: win98
CPU/Ram: p3
Comment:

Hi:
im practicing MYSQL. i have a question regarding that. how can i assign primary key for 2 columns(composite primary key) with CREATE command. EX: EMP_ID,EMP_NAME, EMP_DOB,EMP_SAL; NOW I WANT TO MAKE EMP_ID & EMP_NAME AS COMPOSITE PRIMARY KEY. any help is greatly appreciated.

thank u
Nirav



Sponsored Link
Ads by Google

Response Number 1
Name: brandon
Date: October 31, 2002 at 20:31:29 Pacific
Reply:

To form a primary key from two concantenated fields, just put them in parenthesis separated by a comma.

I.E. PRIMARY KEY (EMP_ID, EMP_NAME)

I'm actually using SSQL on a mainframe, but the syntax should be the same regardless.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: MYSQL Question

PHP/MySQL question www.computing.net/answers/programming/phpmysql-question/9309.html

Mysql question.... www.computing.net/answers/programming/mysql-question/471.html

php data from table mysql newbie www.computing.net/answers/programming/php-data-from-table-mysql-newbie/13702.html