7.5.5.2 Foreign Key Constraints Hi programmers,
I try to code this CREATE TABLE EMPLOYEE ( FNAME VARCHAR(15) NOT NULL, MINIT CHAR, LNAME VARCHAR(15) NOT NULL, SSN CHAR(9) NOT NULL, BDATE DATE, ADDRESS VARCHAR(30), SEX CHAR, SALARY DECIMAL(10,2), SUPERSSN CHAR(9), DNO INT NOT NULL, PRIMARY KEY (SSN), # INDEX (SUPERSSN, DNO), FOREIGN KEY (SUPERSSN) REFERENCES EMPLOYEE(SSN), FOREIGN KEY (DNO) REFERENCES DEPARTMENT(DNUMBER) )TYPE = INNODB; And mysql complains with ERROR 1005 at line 9: Can't create table '.\company\employee.frm' (errno: 150) Bye Can someone please help me to fix this code? I think something is wrong with the index declaration, or with the foreign key constraint. But what can I do ? Yours sincerely Morten Gulbrandsen -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]