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

Introduction to the Teradata® RDBMS for UNIX® Version 2 Release 2.1 - NCR

NCR Introduction to the Teradata® RDBMS for UNIX® Version 2 Release 2.1 - NCR, 1998. - 315 p.
Download (direct link): inntroduktionteradata1998.pdf
Previous << 1 .. 21 22 23 24 25 26 < 27 > 28 29 30 31 32 33 .. 76 >> Next


IF you want to learn more about . . . THEN see this manual . . .
The relational model of database management Teradata RDBMS for UNIX Database Design and Administration
Normalization Teradata RDBMS for UNIX Database Design and Administration
Teradata macros Teradata RDBMS for UNIX SQL Reference

Introduction to the Teradata RDBMS for UNIX

3-15
The Relational Model

For More Information

3-16

Introduction to the Teradata RDBMS for UNIX
Data Definition

Chapter 4

Data Definition

Introduction to the Teradata RDBMS for UNIX
Data Definition

Introduction to the Teradata RDBMS for UNIX
Data Definition

About This Chapter

Introduction

Basic Statements

About This Chapter

This chapter describes the data definition capabilities of Teradata Structured Query Language (SQL), emphasizing the basic elements it operates on, the types of data supported, and the statements and operators SQL uses for its Data Definition Language (DDL) functions. Other topics described are base tables, null handling, and indexes.

The first part of the chapter deals with SQL data definition statements and the basic objects and operators, data types, and other operations SQL supports.

The second part of the chapter describes how to define base tables, while the final topic is indexes.

The following table illustrates the basic statements of SQL data

definition.
Statement Action performed
CREATE Defines a new table, index, macro, or view, depending on the object of the CREATE statement.
DROP Removes a table, index, macro, or view definition, depending on the object of the DROP statement.
ALTER Changes a table or protection definition. For example, you can add or remove columns from a table using this statement.

Introduction to the Teradata RDBMS for UNIX

4-1
Data Definition

Teradata SQL Data Types

Introduction

Teradata SQL Data Types

Teradata SQL Data Types

This topic introduces the data types supported by Teradata SQL.

While data is stored in ASCII format in the Teradata RDBMS, results are returned to a client in its native format, which could be any of

the following:
• ASCII
• EBCDIC
• KatakanaEBCDIC
• KanjiEUC
• KanjiShift-JIS.

The following table lists each data type supported by the Teradata RDBMS and a brief description. |

Data Type Description
INTEGER 32-bit, signed binary whole number. Range: -2,147,483,648 to 2,147,483,647
SMALLINT 16-bit, signed binary whole number. Range: -32,768 to 32,767
BYTEINT 8-bit, signed binary whole number. Range: -128 to 127
DECIMAL[(n[,m])] Packed decimal of n digits, m to the right of the decimal. Precision (n) range: 1 to 18 A system flag, DecimalMax, allows the maximum range value to be set to 0, 15 or 18. See the discussion of data types in the Teradata RDBMS SQL Reference. Scale (m) range: 0 to n
FLOAT 64-bit floating point number in sign-and-magnitude form. Range: 2.226 x 10-308 to 1.797 x 10308
CHAR(n) Fixed length character string of n characters. Range: 32,000 is the maximum for n

4-2

Introduction to the Teradata RDBMS for UNIX
Data Definition

Teradata SQL Data Types

Data Type Description
VARCHAR(n) Variable length character string of maximum length n. Range: 32,000 is the maximum for n
LONG VARCHAR Longest variable length character string. Equivalent to VARCHAR(32000)
BYTE(n) Fixed length binary string of n bytes. Range: 32,000 is the maximum for n
VARBYTE(n) Variable length binary string of maximum value n. Range: 32,000 is the maximum for n
DATE 32-bit integer that represents the date in YY/MM/DD format.
NUMERIC See description for DECIMAL.
REAL See description for FLOAT.
DOUBLE PRECISION See description for FLOAT.

Teradata SQL Column Attributes

The following table lists each column attribute type supported by the Teradata RDBMS and a brief description.

Column Attribute Description
NULL Field can be null.
NOT NULL Field can not be null.
COMPRESS Space occupied by one or more columns can be compressed to zero space for a given value.
BETWEEN n AND n Range constraint. Available for the following data types: • INTEGER • SMALLINT • BYTEINT • DECIMAL • FLOAT • DATE

Introduction to the Teradata RDBMS for UNIX

4-3
Data Definition

Teradata SQL Data Types

Column Attribute Description
CONSTRAINT Type or range constraint. CONSTRAINTs can be named at either the column or table level. Naming makes it easier to drop or alter a CONSTRAINT. Valid CONSTRAINTs are: • PRIMARY KEY • UNIQUE • CHECK • FOREIGN KEY
CASESPECIFIC Data stored as it is entered and not converted to uppercase for comparison operations. This is the default in ANSI mode.
NOT CASESPECIFIC Data is converted to uppercase for comparison operations. This is the default in Teradata mode.
UPPERCASE Data stored in all capital letters irrespective of how it is entered.
FORMAT Specifies the display format for column data. Available for the following data types: • Character • Numeric • DATE
Previous << 1 .. 21 22 23 24 25 26 < 27 > 28 29 30 31 32 33 .. 76 >> Next