在下表中输入值时,如何在SQL的同一表的列上强制使用外键约束:
员工人数 :
CREATE TABLE TABLE_NAME ( `empid_number` int ( 11) NOT NULL auto_increment, `employee` varchar ( 100) NOT NULL , `manager_number` int ( 11) NOT NULL , PRIMARY KEY (`empid_number`), CONSTRAINT `manager_references_employee` FOREIGN KEY (`manager_number`) REFERENCES (`empid_number`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8
希望能帮助到你!