1.插入数据时的外键约束
由于我们在category这个表中没有定义pid=8,所以在这里无法插入
insert into product values(null,'oppo',2999,null,8);
2.删除数据时的外键约束
由于我们在表product中添加了分类IP为5的数据,所以我们无法删除
delete from category where cid=5;
1.插入数据时的外键约束
由于我们在category这个表中没有定义pid=8,所以在这里无法插入
insert into product values(null,'oppo',2999,null,8);
2.删除数据时的外键约束
由于我们在表product中添加了分类IP为5的数据,所以我们无法删除
delete from category where cid=5;