Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Teradata RDBMS forUNIX SQL Reference - NCR

NCR Teradata RDBMS forUNIX SQL Reference - NCR, 1997. - 913 p.
Download (direct link): teradataforunix1997.pdf
Previous << 1 .. 125 126 127 128 129 130 < 131 > 132 133 134 135 136 137 .. 241 >> Next


8-74

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

CREATE TABLE

Syntax Element...

Description

BEFORE

JOURNAL

AFTER JOURNAL

Specifies the type of image to be maintained for the table.

The default for this option is established by a CREATE DATABASE, CREATE USER, or MODIFY USER statement for the database in which the table is to be created.

IF this keyword is specified . . . THEN this type of journal image is maintained . . .
none both. This option may appear twice in the same statement: once to specify a BEFORE or AFTER image, and again to specify the alternate type.
BEFORE or AFTER only the default for that type is overridden. For example, if AFTER is specified, before-image journaling remains at the default setting.
BEFORE and AFTER both, but the two specifications must not conflict with one another.

FREESPACE integer Used to set the percent of free space that will

remain on a cylinder during loading operations.

Specifies the value of the percent freespace attribute to the specified value integer.

If the specified value does not fall within the allowable range (0 to 75 percent), an error message is generated.

PERCENT This keyword can be optionally specified. It has

no effect whether it is specified or not.

Teradata RDBMS for UNIX SQL Reference

8-75
Teradata SQL Syntax Guide

CREATE TABLE

Syntax Element... Description
Data Block Size Option
DATABLOCKSIZE = integer BYTES DATABLOCKSIZE = integer KBYTES DATABLOCKSIZE = integer KILOBYTES Sets the value of the data block size attribute to the value integer. (See also the discussion of DEFAULT, MINIMUM or MAXIMUM DATABLOCKSIZE.)
MINIMUMDATAB LOCKSIZE MAXIMUM DATABLOCKSIZE The minimum DATABLOCKSIZE is 12 sectors, where each sector is 512 bytes i.e. the minimum is 6,144 bytes. The maximum DATABLOCKSIZE is 63 sectors, where each sector is 512 bytes, i.e. the maximum is 32,256 bytes.
Column Definition
col_name col_name specifies the name of one or more columns, in the order in which they and their attributes are to be defined for the table. Up to 256 columns can be defined for a table.
data type definition data type attribute Data type definition and data type attribute designates one or more data definition phrases that define data for the column. A single Data Type must be specified for each col_name. The use of other phrases is optional. Data Types and attributes used to define table columns are described in the CREATE TABLE syntax diagrams and in Chapter 5. A column definition must include exactly one data type definition with optional data attributes. It is recommended that the type definition be listed before any attributes.

8-76

Teradata RDBMS for UNIX SQL Reference
Teradata SQL Syntax Guide

CREATE TABLE

Syntax Element... Description
Column Storage Attributes Column storage attributes are a Teradata RDBMS extension to ANSI SQL.
COMPESS COMPRESS allows specified values in one or more columns to be compressed to zero space. If any column is to be compressed, the order should be chosen to achieve maximum accessibility.
NULL If NULL is specified, nulls are compressed. Null data for that value would not take much space, hence COMPRESSing nulls does not save as much space as COMPRESSing other data types.
constant If constant is specified, NULLS and the value are compressed. Constants are typically character type quotestrings. The most space a numeric value can take is 8 bytes. Using COMPRESS on a numeric is not recommended. Using COMPRESS on fixed length character data saves space depending on the percentage of rows for which the compressed value is assigned. Using variable length character data is preferable to COMPRESS for most applications.
Column Constraint Attributes The column listed as UNIQUE or PRIMARY KEY must be NOT NULL.
CONSTRAINT name Constraint names are an extension to ANSI SQL. See the Note below this table and the section “Constraint Names”.
UNIQUE specifies that no two rows in the table can have the same value in the indexed field. Used on a single column.
PRIMARY KEY designates that the values of the column are to be used as the basis of a unique primary or secondary index for the table.

Teradata RDBMS for UNIX SQL Reference

8-77
Teradata SQL Syntax Guide

CREATE TABLE

Syntax Element... Description
CHECK (boolean conditio) boolean condition is a conditional expression, including scalar comparison predicates using, for example, any of the following: • = • <> • > • >= See also Chapter 6, “SQL Expressions.” When CHECK is part of the column definition, then a search condition cannot reference any columns other than the one being defined, nor are aggregate functions allowed. See also “Check Constraints”, below.
REERENCES tnme col_name list Each reference column in the REFERENCES clause identifies a col_name of the referenced table tname. tname must refer to a base table. It cannot refer to that of a view. See also REFERENCES, below.
Previous << 1 .. 125 126 127 128 129 130 < 131 > 132 133 134 135 136 137 .. 241 >> Next