1

i have a foreign key that is set to unique and I need it set to mul. What is the command t do that?

5
  • You mean multiple columns or MUL what?
    – user1088172
    May 8, 2013 at 2:17
  • need to make it a non-unique index
    – Jessica
    May 8, 2013 at 2:27
  • CREATE TABLE IF NOT EXISTS instructorstudentgroup ( InstructorStudentGroupID int(2) NOT NULL AUTO_INCREMENT, Instructor varchar(60) DEFAULT NULL, ClinicalID int(2) DEFAULT NULL, Location varchar(30) DEFAULT NULL, PRIMARY KEY (InstructorStudentGroupID), UNIQUE KEY ClinicalID (ClinicalID) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    – Jessica
    May 8, 2013 at 2:28
  • I disabled the foreign key checks dropped the table then recreated it with just Key ClinicalID (ClinicalID)
    – Jessica
    May 8, 2013 at 2:31
  • Check the answer below please
    – user1088172
    May 8, 2013 at 7:06

1 Answer 1

0

I assume that you want to alter your unique key

CREATE TABLE IF NOT EXISTS instructorstudentgroup 
( InstructorStudentGroupID int(2) NOT NULL AUTO_INCREMENT, 
Instructor varchar(60) DEFAULT NULL, 
ClinicalID int(2) DEFAULT NULL, 
Location varchar(30) DEFAULT NULL, 
PRIMARY KEY (InstructorStudentGroupID), 
UNIQUE KEY ClinicalID (ClinicalID) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 

And this is to drop your ClinicalID

alter table instructorstudentgroup drop index ClinicalID;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.