ocp 10g和11g 1z0 047考试题库中文解析(1)

1Z0-047 51-100
1Z0-047 1-50  
1. You need to load information about new customers from the NEW_CUST table into the tables CUST and CUST_SPECIAL. If a new customer has a credit limit greater than 10,000, then the details have to be inserted into CUST_SPECIAL. All new customer details have to be inserted into the CUST table. Which technique should be used to load the data most efficiently?
A. external table
B. the MERGE command
C. the multitable INSERT command
D. INSERT using WITH CHECK OPTION
答案: C
分析: 本题考点是multitable INSERT
题目要求将NEW_CUST表上所有的记录插入CUST表,credit limit大于10000的记录要同时插入CUST_SPECIAL表,应该使用有条件的insert命令,sql如下:
insert all
  when credit_limit>=10000 into CUST_SPECIAL
  when 1=1 into CUST
A. 外部表是只读的,不能进行插入操作
B. merge命令只能针对一张表进行插入或者修改操作,不能针对多张表进行插入操作
D. insert命令没有with check option选项,with check option选项是create view时使用的

2. View the Exhibit and examine the description of the CUSTOMERS table. You want to add a constraint on the CUST_FIRST_NAME column of the CUSTOMERS table so that the value inserted in the column does not have numbers. Which SQL statement would you use to accomplish the task?
A. ALTER TABLE CUSTOMERS ADD CONSTRAINT cust_f_name CHECK(REGEXP_LIKE(cust_first_name,'^AZ')) NOVALIDATE;
B. ALTER TABLE CUSTOMERS ADD CONSTRAINT cust_f_name CHECK(REGEXP_LIKE(cust_first_name,'^[09]')) NOVALIDATE;
C. ALTER TABLE CUSTOMERS ADD CONSTRAINT cust_f_name CHECK(REGEXP_LIKE(cust_first_name,'[[:alpha:]]'))NOVALIDATE;
D. ALTER TABLE CUSTOMERS ADD CONSTRAINT cust_f_name CHECK(REGEXP_LIKE(cust_first_name,'[[:digit:]]'))NOVALIDATE;
答案: C
分析: 本题考点是正则表达式/REGEXP
要在表CUSTOMERS的字段CUST_FIRST_NAME建个约束,使这个字段不能包含数字
A. 匹配开头是AZ的字符串。
B. 匹配开头是0或者是9的字符串。
C. 匹配包含字母的字符串。
D. 匹配包含数字的字符串。

3. Which three tasks can be performed using regular expression support in Oracle Database 10g? (Choose three.)
A. It can be used to concatenate two strings.
B. It can be used to find out the total length of the string.
C. It can be used for string manipulation and searching operations.
D. It can be used to format the output for a column or expression having string data.
E. It can be used to find and replace operations for a column or expression having string data.
答案: CDE
分析: 本题考点是正则表达式/REGEXP
Oracle 10g支持正则表达式的函数主要有REGEXP_LIKE、REGEXP_INSTR、REGEXP_SUBSTR、REGEXP_REPLACE,用来寻找或替换匹配的字符串
A. 连接两个字符串用符号||,正则表达式没有这个功能。
B. 字符串的长度是用length()函数,正则表达式没有这个功能。

4. View the Exhibit and examine the structure of the EMP table which is not partitioned and not an indexorganized table. Evaluate the following SQL  statement:
ALTER TABLE emp DROP COLUMN first_name;
Which two statements are true regarding the above command? (Choose two.)
A. The FIRST_NAME column would be dropped provided it does not contain any data.
B. The FIRST_NAME column would be dropped provided at least one or more columns remain in the table.
C. The FIRST_NAME column can be rolled back provided the SET UNUSED option is added to the above SQL statement.
D. The FIRST_NAME column can be dropped even if it is part of a composite PRIMARY KEY provided the CASCADE option is used.
答案: BD
分析: 本题考点是set unused
EMP表不是分区表也不是所引组织表,drop columns是物理删除,set unused是逻辑删除,两者都不可以通过rollback恢复,所有引用到该列的对象都会失败。
A. 不管列上有没有数据,删除列的命令都可以正常执行。
C. set unused的列无法访问,无法使用rollback撤销unused设置

5. Evaluate the CREATE TABLE statement:
CREATE TABLE products (product_id NUMBER(6) CONSTRAINT prod_id_pk PRIMARY KEY, product_name VARCHAR2(15));
Which statement is true regarding the PROD_ID_PK constraint?
A. It would be created only if a unique index is manually created first.
B. It would be created and would use an automatically created unique index.
C. It would be created and would use an automatically created nonunique index.
D. It would be created and remains in a disabled state because no index is specified in the command.
答案: B
分析: 本题考点是主键约束和唯一性约束自动建立索引
Oracle在创建主键约束或唯一性约束时,会自动检测该列是否创建过唯一性索引,如果有则不创建而直接使用,如果没有则自动隐式创建唯一性索引。
A. 创建主键约束不需要首先手动创建唯一性索引,Oracle会自动隐式创建唯一性索引
C. 创建主键约束时,Oracle会自动隐式创建的索引是唯一性索引
D. 创建主键约束时没有指定索引,Oracle会自动寻找唯一性索引,找不到则会自动创建唯一性索引。所有约束创建时默认都是自动生效的

6. Which two statements are true? (Choose two.)
A. The USER_SYNONYMS view can provide information about private synonyms.
B. The user SYSTEM owns all the base tables and useraccessible views of the data dictionary.
C. All the dynamic performance views prefixed with V$ are accessible to all the database users.
D. The USER_OBJECTS view can provide information about the tables and views created by the user.
E. DICTIONARY is a view that contains the names of all the data dictionary views that the user can access.
答案: AE
分析: 本题考点是数据字典/data dictionary
B. system用户是操作系统管理员,sys才是数据库管理员,数据字典的所有基表和视图都属于sys用户。
C. v$为前缀的动态性能视图要有DBA权限才能访问。
D. USER_OBJECTS视图不仅包含用户的表、视图信息,还包括了其他对象如触发器、索引、过程等等。

7. View the Exhibit and examine the description of the ORDERS table. Which two WHERE clause conditions demonstrate the correct usage of conversion functions? (Choose two.)
A. WHERE order_date > TO_DATE('JUL 10 2006','MON DD YYYY')
B. WHERE TO_CHAR(order_date,'MON DD YYYY') = 'JAN 20 2003'
C. WHERE order_date > TO_CHAR(ADD_MONTHS(SYSDATE,6),'MON DD YYYY')
D. WHERE order_date IN ( TO_DATE('Oct 21 2003','Mon DD YYYY'), TO_CHAR('NOV 21 2003','Mon DD YYYY') )
D. WHERE order_date IN ( TO_DATE('Oct 21 2003','Mon DD YYYY'), TO_CHAR('NOV 21 2003','Mon DD YYYY') )
答案: AB
分析: 本题考点是日期格式/date type
C. order_date是timestamp with local timezone数据类型,TO_CHAR(ADD_MONTHS(SYSDATE,6),'MON DD YYYY')返回的是字符串,如果不符合系统时间格式则Oracle无法隐式转换,两者比较时会出错。
D. in是集合操作符,集合中TO_DATE('Oct 21 2003','Mon DD YYYY')返回date格式,TO_CHAR('NOV 21 2003','Mon DD YYYY')返回字符串,数据类型不一致。

8. View the Exhibit and examine the description of the EMPLOYEES table. Your company decided to give a monthly bonus of $50 to all the employees who have completed five years in the company. The following statement is written to display the LAST_NAME, DEPARTMENT_ID, and the total annual salary:
SELECT last_name, department_id, salary+50*12 "Annual Compensation" FROM employees WHERE MONTHS_BETWEEN(SYSDATE, hire_date)/12 >= 5;
When you execute the statement, the "Annual Compensation" is not computed correctly. What changes would you make to the query to calculate the annual compensation correctly?
A. Change the SELECT clause to SELECT last_name, department_id, salary*12+50 "Annual Compensation".
B. Change the SELECT clause to SELECT last_name, department_id, salary+(50*12) "Annual Compensation".
C. Change the SELECT clause to SELECT last_name, department_id, (salary+50)*12 "Annual Compensation".
D. Change the SELECT clause to SELECT last_name, department_id, (salary*12)+50 "Annual Compensation".
答案: C
分析: 本题要求为每个工作满5年的员工的月工资增加$50,返回他们的LAST_NAME、DEPARTMENT_ID和年薪,年薪=(salary+50)*12。

9. Evaluate the following CREATE SEQUENCE statement:
CREATE SEQUENCE seq1 START WITH 100 INCREMENT BY 10 MAXVALUE 200 CYCLE NOCACHE;
The sequence SEQ1 has generated numbers up to the maximum limit of 200. You issue the following SQL statement:
SELECT seq1.nextval FROM dual;
What is displayed by the SELECT statement?
A. 1
B. 10
C. 100
D. an error
答案: A
分析: 本题考点是序列/SEQUENCE
START WITH 100指定序列第一次使用是从100开始,INCREMENT BY 10指定序列每次使用增加10,MAXVALUE 200指定序列最大值为200,CYCLE指定序列可以循环使用,NOCACHE指定序列不使用缓存。序列没有设置minvalue参数,所以这个序列第一次使用从100开始,每用1次增加10,达到最大值200后循环到minvalue,由于没有设置minvalue,所以使用默认值1。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值