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值,如果有的话就修改不了,如果没有的话,是可以修改的
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