CREATE TABLE `Employee` ( `emp_id` INT PRIMARY KEY, `name` VARCHAR(20), `birth_date` DATE, `sex` VARCHAR(2), `salary` INT, `branch_id` INT, `sup_id` INT, FOREIGN KEY (`branch_id`) REFERENCES `Branch` (`branch_id`) ON DELETE SET NULL );
Some small problems in the process of learning the database,
INSERT INTO `Employee` VALUES (206, `Xiaohuang`, `1998-10-08`, `male`, 50000,NULL,NULL);
When we insert this data, an error is reported
But what we define is the name of the string type and our input is indeed the quotation mark under ~ esc
when i change to
INSERT INTO `Employee` VALUES (206, 'Xiaohuang', '1998-10-08', 'male', 50000,NULL,NULL);
The program runs successfully