zoukankan      html  css  js  c++  java
  • 052-168

    You execute this command to drop the ITEM table, which has the primary key referred in the ORDER
    table:
    SQL> DROP TABLE scott.item CASCADE CONSTRAINTS PURGE;
    Which two statements are true about the effect of the command? (Choose two.)
    A.No flashback is possible to bring back the ITEM table.
    B.The ORDER table is dropped along with the ITEM table.
    C.The dependent referential integrity constraints in the ORDER table are disabled.
    D.The dependent referential integrity constraints in the ORDER table are removed.
    E.The table definition of the ITEM table and associated indexes are placed in the recycle bin.

    由于使用了 PURGE,不会将表和相关的对象放入回收站,因此 flashback 不能用,A 对,E 错
    指定 CASCADE CONSTRAINTS 语句是指删除所有的参照完整性约束包括主键约束和唯一性约束。
    如果不指定此语句,则参照完整性约束还存在,drop table 时会返回一个错误。 C 错,D 对
    B 错误,如果想实现这个需要级联删除,
    alter table order_status2 add constraint order_status2_modified_by_fk modified_by references
    employees(employee_id) on delete cascade;
    --使用了 on delete cascade 语句,用于删除父表一条记录的时候,子表记录也要删除
    alter table order_status2 add constraint order_status2_modified_by_fk modified_by references
    employees(employee_id) on delete set null;
    --这里使用了 on delete set null 语句,当父表删除的时候,子表记录就会设置为空

  • 相关阅读:
    代办事项
    问题总结2015/05/05
    Android Studio 更新
    Android 防内存泄露handler
    android canvas 绘图笔记
    Android Studio compile error : enum constant INSTANT_RUN_REPLACEMENT does not exist in class
    android Studio 配置LUA 开发环境
    Android 性能优化之(1)-MAT使用教程
    shareSdk打包报错解决办法
    Android 事件分发机制
  • 原文地址:https://www.cnblogs.com/Babylon/p/8039202.html
Copyright © 2011-2022 走看看