Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create mysql column with Key=MUL?

Tags:

mysql

I want to make a column with key = mul. What should I add to the following statement to make it do that?

alter table skills_required add column skill_id int (11) NOT NULL;

Thanks for the help!

like image 938
Andrew Avatar asked Feb 16 '11 00:02

Andrew


1 Answers

Add a non-primary key on the field:

alter table skills_required add column skill_id int (11) NOT NULL
                          , add key ( skill_id )
like image 127
martin clayton Avatar answered Nov 03 '22 23:11

martin clayton