071-新增2

  1. Evaluate the commands issued by the DBA:
    1 - CREATE ROLE mgr;
    2 - GREATE CREATE TABLE, SELECT ON oe.orders TO mgr;
    3 - GRANT mgr, create table TO SCOTT;
    Which statement is true regarding the execution of the above commands?
    A) Statement1 would not execute because the WITH GRANT option is missing
    B) Statement 1 would not execute because the IDENTIFIED BY clause is missing.
    C) Statement3 would not execute because role and system privileges cannot be granted together in a single CRANT statement.
    D) Statement 2 would not execute because system privileges and object privileges cannot be granted together in a single GRANT command.

create table 属于系统权限,SELECT ON oe.orders TO mgr 属于角色权限,两者不能放 在一个 grant 语句中;而角色权限,和对象权限可以放在同一个 grant 语句中

  1. You need to display the first names of all customers from the CUSTOMERS table that contain the character ‘e’ and have the character ‘a’ in the second last position. Which query would give the required output?
    A) SEIECT cust_ first_name FROM customers WHERE INSTR (cust_ first_name, 'e ’ )<>0 AND SUBSTR(cust_ first_name, -2, 1)=‘a’;
    B)SEIECT cust_ first_name FROM customers WHERE INSTR (cust_ first_name, ‘e ’ )<>’ ’ AND SUBSTR(cust_ first_name, -2, 1)=‘a’;
    C) SEIECT cust_ first_name FROM customers WHERE INSTR (cust_ first_name, 'e ’ ) IS NOT NULL AND SUBSTR(cust_ first_name, -2, 1)=‘a’;
    D)SEIECT cust_ first_name FROM customers WHERE INSTR (cust_ first_name, 'e ’ )<>0 AND SUBSTR(cust_ first_name, LENGTH(cust_ first_name,-2)=‘a’;

要从 CUSTOMERS 表中显示所有 customers 的 first names,名字中要包含 e,并且倒 数第二个字符要包含 a A 选项正确,INSTR 如果不包含字符则返回 0,不等于 0,说明包含了 e 字符,SUBSTR 可以从倒数第二个字符开始截取一个字符。 B 选项不正确,INSTR 的结果<>’’,永远为 false。 C 选项不正确,INSTR 的结果不可能为 null。 D 选项不正确,SUBSTR 不是截取的倒数第二个字符。

  1. Examine these SQL statements that are executed in the given order: CREATE TABLE emp (emp_ no NUMBER(2) CONSTRAINT emp_emp_no_pk PRTMARY KEY, ename VARCHAR2 (15), Salary NUMBER(8,2), mgr_ no NUMBER(2) CONSTRAINT emp_mgr_fk REFERENCES emp(emp no));
    ALTER TABLE emp DISABLE CONSTRAINT emp_ emp_no_ pk CASCADE;
    ALTER TABLE emp ENABLE CONSTRAINT emp_ emp_ no_ pk;
    What will be the status of the foreign key EMP _MGR _ FK?
    A) It will be enabled and deferred.
    B) It will be enabled and immediate.
    C) It will remain disabled and can be re- enabled manually.
    D) It will remain disabled and can be enabled only by dropping the foreign key constraint and re-creating it.

禁用后又开启主键,外键需要手动开启

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值