一、原题
二、题目翻译
三、题目解析
四、测试
SQL> create table emp_details
2 (
3 emp_id number(4) not null ,
4 emp_name varchar2(40) not null,
5 emp_image long
6 );
Table created.
SQL> select emp_image
2 from emp_details
3 group by emp_image;
group by emp_image
*
ERROR at line 3:
ORA-00997: illegal use of LONG datatype
SQL> select emp_image
2 from emp_details
3 order by emp_image;
select emp_image
*
ERROR at line 1:
ORA-00997: illegal use of LONG datatype
SQL> alter table emp_details add(b long);
alter table emp_details add(b long)
*
ERROR at line 1:
ORA-01754: a table may contain only one column of type LONG
Examine the description of the EMP_DETAILS table given below:
Exhibit:
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. You cannot add a new column to the table with LONG as the data type
C. An EMP_IMAGE column cannot be included in the ORDER BY clause
D. You can alter the table to include the NOT NULL constraint on the EMP_IMAGE column
答案: B,C
Exhibit:
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. You cannot add a new column to the table with LONG as the data type
C. An EMP_IMAGE column cannot be included in the ORDER BY clause
D. You can alter the table to include the NOT NULL constraint on the EMP_IMAGE column
答案: B,C
二、题目翻译
下面是EMP_DETAILS表的结构
下面关于能在EMP_DETAIL表上执行的SQL语句,哪两个描述是正确的?(选择两项)
A.EMP_IMAGE列可以放在GROUP BY子句中。
B.不能增中一个LONG类型的新列到表中。
C.EMP_IMAGE列不能放在ORDER BY子句中。
D.可以把这张表EMP_IMAGE列加上NOT NULL约束。
下面关于能在EMP_DETAIL表上执行的SQL语句,哪两个描述是正确的?(选择两项)
A.EMP_IMAGE列可以放在GROUP BY子句中。
B.不能增中一个LONG类型的新列到表中。
C.EMP_IMAGE列不能放在ORDER BY子句中。
D.可以把这张表EMP_IMAGE列加上NOT NULL约束。
三、题目解析
EMP_IMAGE列是LONG类型,一张表中,最多只能有一列是LONG类型,所以B正确。
LONG类型,不能放在GROUP BY子句中,也不能放在ORDER BY子句中。所以,C正确,A不正确。
LONG类型,也不能加NOT NULL约束。
LONG类型,不能放在GROUP BY子句中,也不能放在ORDER BY子句中。所以,C正确,A不正确。
LONG类型,也不能加NOT NULL约束。
四、测试
SQL> create table emp_details
2 (
3 emp_id number(4) not null ,
4 emp_name varchar2(40) not null,
5 emp_image long
6 );
Table created.
SQL> select emp_image
2 from emp_details
3 group by emp_image;
group by emp_image
*
ERROR at line 3:
ORA-00997: illegal use of LONG datatype
SQL> select emp_image
2 from emp_details
3 order by emp_image;
select emp_image
*
ERROR at line 1:
ORA-00997: illegal use of LONG datatype
SQL> alter table emp_details add(b long);
alter table emp_details add(b long)
*
ERROR at line 1:
ORA-01754: a table may contain only one column of type LONG