Oracle中的null测试题create table TABLE1(ID VARCHAR2(10) not null,GRZHYE NUMBER(10,2),GMSFHM VARCHAR2(18),RYLB varchar2(10),CARDNO VARCHAR2(20));comment on column TABLE1.ID is "个人编号";comment on column TABLE1.GRZHYE is "个人账户余额";comment on column TABLE1.GMSFHM is "公民身份号码";comment on column TABLE1.RYLB is "人员类别";comment on column TABLE1.CARDNO is "卡号";alter table TABLE1 add constraint PK_TABLE1 primary key (ID);create index IDX_TABLE1_GMSFHM on TABLE1 (GMSFHM) tablespace YB;create index idx_table1_cardno on TABLE1 (cardno);表中的数据如下:id, grzhye, gmsfhm, rylb, cardno1, 100, 123456770707771, 01, 14010000012, null, 123456770707772, null, null3, 200, 123456770707773, 03, 14010000031. select count(*) from table1 where 1=2; 结果为( )A. null B. 0 C. 1 D. 会报错2. select sum(grzhye) from table1 where 1=2; 结果为( )A. null B. 0 C. 1 D. 会报错3. select sum(grzhye) from table1; 结果为( )A. null B. 0 C. 300 D. 会报错4. select count(*) from (select sum(grzhye) from table1 where 1=2); 结果为( )A. 0 B. 1 C. null D. 会报错5. select avg(grzhye) from table1; 结果为( )A. null B. 0 C. null D. 150 E. 1006. 执行以下语句会 ( )alter table TABLE1 add constraint udx_table1_cardno unique (CARDNO);A. 成功 B. 报错7. select * from table1 where cardno is null; 如果优化方式按规则,是否会用到idx_table1_cardno索引( )A.会 B.不会8. select * from table1 where cardno =’123’; 如何优化方式按规则,是否会用到idx_table1_cardno索引( )A.会 B.不会9. select min(grzhye) from table1; 结果是( )A. null B. 100 C. 报错10. select id||cardno from table1 where id = ‘2’; 结果会是:( )A. null B. 2 C. 报错11. Select 100 + null from dual; 结果是( )A. null B. 100 C. 报错12. Select 100 * null from dual; 结果是( )A. null B. 100 C. 0 D. 报错13. Select 100 / null from dual; 结果是( )A. null B. 100 C. 0 D. 报错14. Select null/0 from dual; 结果是( )A. null B. 0 C. 报错15. select rylb,sum(grzhye)/count(rylb) from table1 group by rylb;会查到( )条记录A. 0条 B. 2条 C. 3条 D. 报错16. select 100/sum(grzhye) from table1 where id="2"; 结果是: ( )A. null B. 0 C. 100 D. 报错17. update table1 set cardno = null where id="2";update table1 set cardno = ‘’ where id="2";以上两句,( )A. 效果是相同的 B. 只有第一句成功 C. 只有第二句成功18. select * from table1 where cardno=""; 会查到几条记录 ( )A. 0 B. 1 C. 报错19. select * from table1 where cardno is null; 会查到几条记录 ( )A. 0 B. 1 C. 报错20. select count(cardno) from table1; 会查到几条记录 ( )A. 0 B. 2 C.3 D. 报错
更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12Oracle中的高水位(HWM)Oracle中的soaptest相关资讯 Oracle高级培训
- delete表的数据后恢复 (08/30/2012 08:59:58)
- 使用ASH信息,发现高CPUsession (08/14/2012 07:21:32)
- 如何阅读Oracle Errorstack Output (08/14/2012 07:15:47)
| - Oracle Apps Patching:adpatch( (08/16/2012 15:41:37)
- 话说V$SQL_MONITOR (08/14/2012 07:19:54)
- Oracle Apps DBA工具:ADADMIN使用 (08/14/2012 07:00:09)
|
本文评论 查看全部评论 (0)