代码编织梦想

一、原题

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

二、题目翻译
看下面EMP_DETAILS表的结构
关于能在EMP_DETAILS 表上执行的SQL语句,哪两句话是正确的?(选择两个)
A. EMP_IMAGE列可以包含在GROUP BY子句中
B. EMP_IMAGE列不可以包含在ORDER BY子句中
C. 不能添加一个新的LONG数据类型列
D. 可以把EMP_IMAGE列转换成NOT NULL约束

三、题目解析
A选项不正确,因为LONG列不能包含在GROUP BY子句中,当然也不能包含在ORDER BY或者DISTINCT或者CONNECT BY子句中。
D选项不正确,因为如果列中已经有值可能会包含空值,这样就不能设置为NOT NULL。因为LONG是oracle将要废弃的类型,所

以在10g和11g中都没有查到相关资料,在9i中找到了相关说明:
http://docs.oracle.com/cd/B10501_01/appdev.920/a96590/adfnstyp.htm#434992
LONG columns cannot appear in certain parts of SQL statements:
    1) GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses or with the DISTINCT operator in SELECT statements
    2) The UNIQUE operator of a SELECT statement
    3) The column list of a CREATE CLUSTER statement
    4) The CLUSTER clause of a CREATE MATERIALIZED VIEW statement
    5) SQL built-in functions, expressions, or conditions
    6) SELECT lists of queries containing GROUP BY clauses
    7) SELECT lists of subqueries or queries combined by the UNION, INTERSECT, or MINUS set operators
    8) SELECT lists of CREATE TABLE ... AS SELECT statements
    9) ALTER TABLE ... MOVE statements
    10) SELECT lists in subqueries in INSERT statements

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/holly2008/article/details/23692987

21.examine the description of the emp-爱代码爱编程

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           LO

ocp—051试题答案解析-爱代码爱编程

1Z0-051 1. View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES tables. The PROD_ID column is the foreign key in the SALES table, w

1z0-051 20. which three statements are true regarding the data types in oracle database 10g/11g?-爱代码爱编程

20. Which threestatements are true regarding the data types in Oracle Database 10g/11g?(Choose three.) A. Only one LONG column can be used per table. B. A TIMESTAMPdata type co

greendao 3.x 数据库升级,新增int、long数据类型字段not null 解决方案_srg19910228的博客-爱代码爱编程

      项目使用到Greendao当做数据库,升级的时候遇到个问题,但新添加int类型字段的时候,数据迁移报错了,查看到是因为新增int、long类型字段的时候,给的是NOT NULL,就是说不能为空。    数据库升级方案使用的是外国某个大神写的代码,大概思路是: 1、新建一张跟原先表一样的临时表,同时把数据也复制进去。 2、删除原先表 3、新建最新

1z0-071 oracle database 12c sql 第42题 drop语句_城风蔚然的博客-爱代码爱编程

Q42.  Which three statements are true about the ALTER TABLE….DROP COLUMN…. command? A. A column can be dropped only if it does not contain any data. B. A column can be dropped o

oracle ocp 1z0-052 2018年9月最新考过的题库分享-3_byrgzs的博客-爱代码爱编程

1. Which four statements are true about truncating a table? A) Any insert triggers for the table will be executed. B) Any of the table’s indexes are also truncated. C) Any delete

【ORACLE 】ORACLE OCP 071考点记录01-爱代码爱编程

071考点 1.UNION查询语句2.笛卡尔乘积 cross join3.DEFINE 和 SET VERIFY ON/OFF4.ROLLBACK语句回滚范围5.MERGE INTO 的使用6. 操作符1.UNION ALL是全集2.UNION 是联集3.INTERSECT 是交集4.MINUS 是差集7.Oracle 权限1.系统权限2.角色权限

oracle+nonequijoins,【Oracle学习】 OCP-071 练习题中-爱代码爱编程

【Oracle学习】 OCP-071 练习题中 Q101. Which three statements are true about a self join? A. It must be an inner join. B. It must be an equijoin. C. The query must use two different

oracle071考试报名,【2019年8月版本】Oracle OCP认证 071考试原题-57-爱代码爱编程

choose two Examine the description of the BOOKS table: Name Null? Type ------------------------------------------------------------- TRANSACTION_ID       NOT NULL       VARC