21.Examine the description of the EMP_DETAILS table given below:

21.Examine the description of the EMP_DETAILS table given below:
name       NULL     TYPE 
EMP_ID     NOT NULL NUMBER 
EMP_NAME   NOT NULL VARCHAR2 (40)
EMP_IMAGE           LONG
Which two statements are true regarding SQL statements that can be executed on the EMP_DETAIL table? (Choose two.)
A.An EMP_IMAGE column can be included in the GROUP BY clause.
B.An EMP_IMAGE column cannot be included in the ORDER BY clause.
C.You cannot add a new column to the table with LONG as the data type.
D.You can alter the table to include the NOT NULL constraint on the EMP_IMAGE column.
答案:BC
解析:long不能用于group by,order by 子句,一张表只能有一个long类型的列
A:错误,不能包括group by
B:正确,不能包括order by
C:正确,只能有一列
D:错误,这里主要是看该列有没有null值,如果有的话就修改不了,如果没有的话,是可以修改的
SQL> create table test2 (t long);

Table created.

SQL> desc test2;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 T                                                  LONG

SQL> alter table test2 modify t not null;

Table altered.

SQL> desc test2;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 T                                         NOT NULL LONG

SQL> select * from test2 group by t;
select * from test2 group by t
                             *
ERROR at line 1:
ORA-00997: illegal use of LONG datatype

SQL> select * from test2 order by t;
select * from test2 order by t
       *
ERROR at line 1:
ORA-00997: illegal use of LONG datatype





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值