he TIMESTAMP data typeis an extension of the DATE data type. It stores the year,
month, and day of theDATE data type, plus hour, minute, and second values. This
data type is useful forstoring precise time values and for collecting and eva luating
date information acrossgeographic regions.
The BLOB data typestores unstructured binary large objects. BLOB objects can be
thought of as bitstreamswith no character set semantics. BLOB objects can store binary
data up to (4 gigabytes-1) * (the value of the CHUNK parameter of LOB storage). If the
tablespaces in yourdatabase are of standard block size, and if you have used the
default value of theCHUNK parameter of LOB storage when creating a LOB column,
then this is equivalentto (4 gigabytes - 1) * (database block size).
The VARCHAR2 data typespecifies a variable-length character string.When you create
a VARCHAR2 column, yousupply the maximum number of bytes or characters of data
that it can hold. Oraclesubsequently stores each value in the column exactly as you
specify it, provided theva lue does not exceed the maximum length of the column. If
you try to insert avalue that exceeds the specified length, then Oracle returns an error
The CHAR data typespecifies a fixed-length character string. Oracle ensures that all
values stored in a CHARcolumn have the length specified by size. If you inserta
value that isshorter than the column length, then Oracle blank-pads the value to
column length. If you try to insert a value that is too long for thecolumn, then Oracle
returns an error.
21. Examine thedescription of the EMP_DETAILS table given below:
name NULL TYPE
EMP_ID NOT NULL NUMBER
EMP_NAME NOT NULLVARCHAR2 (40)
EMP_IMAGE LONG
Which two statements aretrue regarding SQL statements that can be executed on the EMP_DETAIL
table (Choose two.)
A. An EMP_IMAGE columncan be included in the GROUP BY clause.
B. An EMP_IMAGE columncannot be included in the ORDER BY clause.
C. You cannot add a newcolumn to the table with LONG as the data type.
D. You can alter thetable to include the NOT NULL constraint on the EMP_IMAGE column.
Answer: BC
解析:
引用oracle官方文档:
In addition, LONGcolumns cannot appear in these parts of SQL statements:
■ GROUP BY clauses, ORDER BY clauses, or CONNECT BY clauses orwith the
DISTINCToperator in SELECT statements
■ The UNIQUE operator ofa SELECT statement
■ The column list of aCREATE CLUSTER statement
……
因为 EMP_IMAGE 列的数据类型是LONG类型,所以不能做group by操作,也不能做order by 操作
The use of LONG valuesis subject to these restrictions:
■ A table can contain only one LONG column.
■ You cannot create anobject type with a LONG attribute.
■ LONG columns cannot appear in WHERE clauses or in integrityconstraints (except
that they canappear in NULL and NOT NULL constraints).
…………
所以是不能再添加一个数据类型为LONG的列
也不能设置非空约束
22. You need to create atable for a banking application. One of the columns in the table has thefollowing
requirements:
1) You want a column inthe table to store the duration of the credit period.
2) The data in thecolumn should be stored in a format such that it can be easily added andsubtracted
with
DATE data type withoutusing conversion functions.
3) The maximum period ofthe credit provision in the application is 30 days.
4) The interest has tobe calculated for the number of days an individual has taken a credit for.
Which data type wouldyou use for such a column in the table
A. DATE
B. NUMBER
C. TIMESTAMP
D. INTERVAL DAY TOSECOND
E. INTERVAL YEAR TOMONTH
Answer: D
解析:
能和date直接做加减的数据类型有date