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 .. 26 27 28 29 30 31 < 32 > 33 34 35 36 37 38 .. 76 >> Next


If you want to learn more about . . . THEN see this manual . . .
Teradata SQL Teradata RDBMS for UNIX Database Design and Administration Teradata RDBMS for UNIX SQL
Indexes Teradata RDBMS for UNIX Database Design and Administration

4-20

Introduction to the Teradata RDBMS for UNIX
Data Manipulation

Chapter 5

Data Manipulation

Introduction to the Teradata RDBMS for UNIX
Data Manipulation

Introduction to the Teradata RDBMS for UNIX
Data Manipulation

About This Chapter

About This Chapter

This chapter describes the data definition and manipulation Introduction capabilities of the Teradata Structured Query Language (SQL),

emphasizing the basic statements and expressions used to manipulate data.

SQL (the official pronunciation is “ess-cue-ell”) is a database sublanguage; that is, it’s a subset of the total language that is concerned specifically with relational database entities and operations.

In principle, the SQL language is a combination of at least two subordinate languages and the SELECT statement:

• A data definition language (DDL), which provides statements for the definition and description of entities (CREATE, ALTER, DROP)

• A data manipulation language (DML), which supports statements for manipulating and processing database values (INSERT, UPDATE, DELETE, ROLLBACK). With DML statements, you can insert new rows into a table, update one or more values in stored rows, or delete a row.

• the Select statement, which is used for data retrieval.

The SELECT statement is the basic SQL data manipulation statement in a decision support environment because all information retrieval from a relational database is done using the SQL SELECT statement.

The following table lists and describes the four SQL data manipulation statements.

Statement Description
SELECT Performs query functions. Though SQL does not use them explicitly, the relational algebra functions of Select, Project, Join, Union, Intersect, and Minus are all performed using SELECT.
INSERT Inserts new rows into a table.
UPDATE Modifies values in an existing row (or rows) of a table.
DELETE Removes a row (or rows) from a table.

SQL Data Manipulation

What is the Structured Query Language (SQL)?

Introduction to the Teradata RDBMS for UNIX

5-1
Data Manipulation

The SELECT Statement

The SELECT Statement

The SELECT statement is used to extract data from relational tables Introduction using Teradata SQL.

This topic describes the SELECT statement in some detail.

The SELECT statement and its clauses performs some or all of the Relational Algebra 5 following relational algebra statements. You cannot execute these

operators directly—the SELECT statement itself performs them for you. The purpose of this section is to illustrate the formal algebraic capabilities of the SELECT statement.

Note that the first four operations are from traditional set theory while the second four are special relational operations.

Operator Description
UNION Select all rows belonging to either or both of two named tables A and B.
INTERSECT Select all rows belonging to both of two named tables A and B.
DIFFERENCE Select all rows belonging to table A but not to table B.
PRODUCT Select the concatenation of all rows t such that t is the concatenation of row a belonging to table A and row b belonging to table B. Formally speaking, this operation is called an extended Cartesian product.
SELECT Select a horizontal subset of rows of a table. This operation is not the same as the SQL select, but does provide the WHERE clause function.
PROJECT Select a vertical subset of rows of a table. In other words, select a subset of nonredundant attributes of a table (all unique instances of an attribute or attributes).
JOIN Select rows from two (or more) tables that meet some criterion (equal, not equal, greater than, less than) on primary/foreign keys shared among the tables.
DIVISION Select the result of dividing table A by table B on some common attribute or attributes.

The SQL SELECT builds on these primitive operations to perform all its work.

5-2

Introduction to the Teradata RDBMS for UNIX
Data Manipulation

The SELECT Statement

Teradata SQL Expressions

Arithmetic Operators

Teradata SQL expressions permit you to perform arithmetic and logical operations, to generate new values or Boolean results from constants and stored values, and to select results that meet specific criteria.

An expression can consist of a column name, a constant, or a combination of column names and constants connected by operators.

The Teradata SQL expressions can be grouped as follows:

• Arithmetic operators

• Aggregate operators

• Comparison operators

• Logical operators

• Partial string matching operators

• Set operators

• Other operators

Arithmetic operators support the standard operations of addition, subtraction, multiplication, and division. The following table lists and describes the Teradata SQL arithmetic operators.
Previous << 1 .. 26 27 28 29 30 31 < 32 > 33 34 35 36 37 38 .. 76 >> Next