20151217 OCP047 新题库 1-30

2.evaluate the following create table command;

create table order_item(

order_id number(3),

item_id number(2),

aty number(4),

constraint ord_itm_id_pk primary key (order_id,item_id)

using index(

 create index ord_itm_idx on order_item(order_id,item_id)

)

which statement is true regarding the above sql statement?

a.it would execute successfully and only ord_item_idx index would be created 

b.it would give an error becarse the using index clause cannot be used on a composite primary key

对多个列创建索引是允许的,所以oracle可以为复合主键自动创建索引或使用已经存在的基于复合主键创建的索引

c.it would execute successfully and two indexes ord_item_idx and org_itm_id_pk would be created

oracle创建主键使用了用户提供的索引ord_itm_idx,所以不会再去自动创建主键索引

d.it would give an error because the using index clause is not permitted in the create table

using index使用在主键约束后,和是不是在create语句里没有关系

6.which two statements are true regarding the types of table joins available in oracle database 10g?

c.you can use the using clause to join tables on more than one column

d.you can use the on clause to specify mulitiple conditions while joining tables

11.which two statements are true about the grouping function?

a.it is used to find the groups forming the subtotal in a row

grouping函数将超级合计行和正规的分组行区分开

d.it can only used with rollup and cube operators specified in the group by clause

group by 扩展的诸如rollup和cube所产生的集合中所有的值都被null代表的超级合计行

b.it is used to identify the null value in the aggregate functions

grouping函数是用来区分一个单独的null值与一个代表集合所有值的null值

c.it is used to form the group sets involived in generating ther totals anbd subtotals

这个是rollup的作用

17.view the exhibit and examine the structure of order_items and orders tables.you need to remove from the order_items table those rows that have an order status of 0 and 1 in the orders table 

which delete statements are valid?

a.delete from order_items where order_id in(select order_id from orders where order_status in(0,1,));

c.delete from order_items i where order_id=(select order_id from orders o where i.order_id=o.order_id and order_status in(0,1))

d.delete from (select * from order_items i,orders o where i.order_id=o.order_id and order_status in(0,1)

22.view the exhibit and examine the description of the order_items table,the following sql statement was written teo retrieve the rows for the product_id 

that has a unit_price of more than 1000 and has been orderd moren than five times;

select product_id,count(order_id)total,unit_price from order_items where init_price>1000 and count(order_id)>5

group bt product_id,unit_price;

which statement is true regarding this sql statement?

b.the statement would not execute because the aggregate function is used in the where 

clause

这么简单的问题!

27.which two statements are true regarding subqueries?

a.the order by clause can be used in the subquery

order by 字句可以用在子查询中

b.a subquery can be used in the from clause of a select statement

在from 字句中的子查询成为in-line view;

c.if the subquery returns null,the main query may still returns result rows

not in

d.a subqury can be placed in a where clause,group by clause,or a having cluase

group by 字句中不能使用子查询

e.logical operartors ,such as and ,or and not ,cannot be used in the where cluase of a subquery

可以使用逻辑运算符

28.evaluate the following query

select interval '300' month,interval '54-2' year to month ,interval '11:12"10.123456778'hour to second from dual;

a.+2500,+5402,+00 11:12:10.1234567

30.evaluate the following sql statement;

select product_name||'it's not available for order'

from product_information where product_status='obsolete';

you received the following error while executing the above query;

error;

ora-01756;quoted string not properly terminated

what would you do to execute the query sucdessfully?

c.use quote operator and delimiter to allow the use of single quotation mark in the literal character string

考察的是q 运算符

你可能感兴趣的:(20151217 OCP047 新题库 1-30)