add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Records: 4  Duplicates: 0  Warnings: 0
Records: 4  Duplicates: 0  Warnings: 0
id
1
1
2
4
id t1_id
11 1
22 1
111 2
222 2
Cannot add or update a child row: a foreign key constraint fails (`fiddle`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
Cannot add or update a child row: a foreign key constraint fails (`fiddle`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
Cannot delete or update a parent row: a foreign key constraint fails (`fiddle`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
Cannot delete or update a parent row: a foreign key constraint fails (`fiddle`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`))
id
1
1
2
id t1_id
11 1
22 1
111 2
222 2
Table Create Table
t1 CREATE TABLE `t1` (
  `id` int DEFAULT NULL,
  KEY `idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
Table Create Table
t2 CREATE TABLE `t2` (
  `id` int DEFAULT NULL,
  `t1_id` int DEFAULT NULL,
  KEY `idx` (`t1_id`),
  CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci