ORACLE SQL总结三:DDL语句(三)
n of the next box in the sequence.
Folders containing employee records are stored in each box. The folders are sorted by employee ID. Employee King has ID 100, which is the lowest ID, so his folder is at the bottom of box 1. The folder for employee 101 is on top of 100, 102 is on top of 101, and so on until box 1 is full. The next folder in the sequence is at the bottom of box 2.
In this analogy, ordering folders by employee ID makes it possible to search efficiently for folders without having to maintain a separate index. Suppose a user requests the records for employees 107, 120, and 122. Instead of searching an index in one step and retrieving the folders in a separate step, the manager can search the folders in sequential order and retrieve each folder as found.
www.2cto.com
Index-organized tables provide faster access to table rows by primary key or a valid prefix of the key. The presence of non-key columns of a row in the leaf block avoids an additional data block I/O. For example, the salary of employee 100 is stored in the index row itself. Also, because rows are stored in primary key order, range access by the primary key or prefix involves minimal block I/Os. Another benefit is the avoidance of the space overhead of a separate primary key index.
Index-organized tables are useful when related pieces of data must be stored together or data must be physically stored in a specific order. This type of table is often used for information retrieva l, spatial (see "Overview of
Oracle Spatial"), and OLAP applications (see "OLAP").
5.4 CASCADE的作用
Specify CASCADE to disable any integrity constraints that depend on the specified integrity constraint. To disable a primary or unique key that is part of a referential integrity constraint, you must specify this clause.
使用CASCADE用于取消(disable)任何依赖于其他完整性约束的完整性约束,例如,为了取消(disable)与一个外键约束有关系的主键约束或唯一性约束,你必须使用CASCADE。
5.6 Restrictions on Check Constraints check约束的限制
Check constraints are subject to the following restrictions:
check约束有如下限制:
You cannot specify a check constraint for a view. However, you can define the view using the WITH CHECK OPTIONclause, which is equivalent to specifying a check constraint for the view.
你不能为一个视图指定check约束。但是你可以使用WITH CHECK OPTION从句定义一个视图。这等同与你为视图指定check 约束。
www.2cto.com
The condition of a check constraint can refer to any column in the table, but it cannot refer to columns of other tables.
check约束可以指向一个表的任何列,但是它不能指向其他表的列。
Conditions of check constraints cannot contain the following constructs:
check约束的条件不能包括以下内容
Subqueries and scalar subquery expressions
子查询和scalar subquery
Calls to the functions that are not deterministic (CURRENT_DATE, CURRENT_TIMESTAMP, DBTIMEZONE,LOCALTIMESTAMP, SESSIONTIMEZONE, SYSDATE, SYSTIMESTAMP, UID, USER, and USERENV)
不能调用如下函数CURRENT_DATE,CURRENT_TIMESTAMP, DBTIMEZONE,LOCALTIMESTAMP,SESSIONTIMEZONE,SYSDATE,SYSTIMESTAMP,UID,USER,USERENV
Calls to user-defined functions
调用用户自定义函数
Dereferencing of REF columns (for example, using the DEREF function)
www.2cto.com
Nested table columns or attributes
嵌套表的列或属性
The pseudocolumns CURRVAL, NEXTVAL, LEVEL, or ROWNUM
伪列CURRVAL,NEXTVAL,LEVEL,ROWNUM
Date constants that are not fully specified
没有完全指定(还是定义)的静态数据
作者 yeyelei