oracle 删除关联表数据
emp表eid ename deptno101 aaa 10102 bbb 10103 ccc 20104 ddd 20dept表did deptno city1 10 beijing2 20 shanghai删除DEPT表中城市名是上海,并且删除EMP表中关联的数据给出具体方法.谢谢
其他答案
设定dept表deptno列为主键。alter table dept add constraint pk_deptno primary key (deptno);在emp表deptno列上建立外键引用dept表deptno,指定外键类型为级联删除。alter table emp add constraint fk_deptno foreign key (deptno) references dep 展开
2010-12-29 09:52
来自北京市
赞(0)点赞赞(0)举报
免责声明:问答内容均来源于互联网用户,房天下对其内容不负责任,如有版权或其他问题可以联系房天下进行删除。


