CREATE TABLE `rajesh_testing`.`testing1` (
`EMPLOYEE_NAME` varchar(25) NOT NULL,
`EMPLOYEE_SALARY` decimal(14,0) NOT NULL,
PRIMARY KEY (`EMPLOYEE_NAME`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `rajesh_testing`.`testing2` (
`TEST2_ID` INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
`TEST2_EMPLOYEE_NAME` VARCHAR(25) NOT NULL,
PRIMARY KEY (`TEST2_ID`),
FOREIGN KEY (TEST2_EMPLOYEE_NAME) REFERENCES testing1(EMPLOYEE_NAME) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
创建表test2时遇到错误1215无法创建外键。