Question: when a new entry is submitted to my database, the foreign key isn't updating. Unsure of what to change. My create code is CREATE TABLE

when a new entry is submitted to my database, the foreign key isn't updating. Unsure of what to change. My create code is CREATE TABLE `customer_table` ( `customer_ID` int NOT NULL AUTO_INCREMENT, `first_name` varchar(255) DEFAULT NULL, `last_name` varchar(255) DEFAULT NULL, `address` varchar(255) DEFAULT NULL, `city` varchar(255) DEFAULT NULL, `state` varchar(255) DEFAULT NULL, `Zipcode` int DEFAULT NULL, `telephone_number` varchar(13) DEFAULT NULL, PRIMARY KEY (`customer_ID`) ); CREATE TABLE `order_table` ( `order_ID` int NOT NULL AUTO_INCREMENT, `soup_type` varchar(255) DEFAULT NULL, `soup_quantity` int DEFAULT NULL, `delivery` varchar(255) DEFAULT NULL, `customer_ID` int DEFAULT NULL, PRIMARY KEY (`order_ID`), KEY `fk_customer_ID` (`customer_ID`), FOREIGN KEY (customer_ID) REFERENCES customer_table(customer_ID) ON UPDATE CASCADE ON DELETE CASCADE );

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!