source - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

See Teradata Vantage™ - SQL Data Manipulation Language, B035-1146 for complete documentation of the FROM clause.

FROM
The names of one or more tables or views from which expression is to be derived.
You can create views that reference global temporary tables and volatile tables.
A view can reference a global temporary trace table, but this view is not updatable. See CREATE GLOBAL TEMPORARY TRACE TABLE.
You cannot create a view that references a queue table . See CREATE TABLE (Queue Table Form).
For information about the FROM clause, see Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.
database_name
user_name
Name of the containing database or user for table_name or view_name if something other than the current database or user.
table_name
Name of a data table from which columns for this view are to be projected.
view_name
Name of a view from which columns for this view are to be projected.

joined_table_source

joined_table
Name of a joined user base table or view.
You can create views that reference global temporary tables and volatile tables.
A view can reference a global temporary trace table but such a view is not updatable. See CREATE GLOBAL TEMPORARY TRACE TABLE.
You cannot create a view on a queue table. See CREATE TABLE (Queue Table Form).
INNER
A join in which qualifying rows from one table are combined with qualifying rows from another table according to a specified join condition.
INNER is the form specified by the ANSI SQL-2011 standard. Teradata also supports an extension that allows you to separate join relations using COMMA characters.
Inner join is the default join type for view definitions.
OUTER
A join in which qualifying rows from one table or view that do not have matches in the other table or view, are included in the join result. The rows from the outer table or view are extended with nulls.
See Teradata Vantage™ - SQL Data Manipulation Language, B035-1146 for more information about outer joins.
LEFT OUTER
An outer join on the table or view that was listed first in the FROM clause.
In a LEFT OUTER JOIN, the rows from the left table or view that are not returned in the result of the inner join of the two tables/views are returned in the outer join result and extended with nulls.
RIGHT OUTER
An outer join on the table or view that was listed second in the FROM clause.
In a RIGHT OUTER JOIN, the rows from the right table or view that are not returned in the result of the inner join of the two tables/views are returned in the outer join result and extended with nulls.
FULL OUTER
A join that returns rows, including non-qualifying rows, from both tables or views.
In a FULL OUTER JOIN, rows from both tables that have not been returned in the result of the inner join are returned in the outer join result, and extended with nulls.
JOIN
An introduction to the name of the second table to participate in the join.
joined_table
The name of the joined user base table, view, or derived table.
See Teradata Vantage™ - SQL Fundamentals, B035-1141 for the rules for naming database objects.
You cannot create or replace a view on a queue table (see CREATE TABLE (Queue Table Form)).
ON search_condition
One or more conditional expressions that must be satisfied by the result rows. An ON condition clause is required if the FROM clause specifies outer join syntax.
You cannot specify a SAMPLE clause within a subquery predicate within an ON clause.
CROSS JOIN
A CROSS JOIN is an unconstrained, or Cartesian join. The Cartesian product of two tables/views returns a concatenated product of all rows from all tables or views specified in the FROM clause.
single_table
Name of a user base table or view participating in the join.
You cannot create or replace a view on a queue table (see CREATE TABLE (Queue Table Form)).

derived_table_source

A derived table is constructed by evaluating a table expression over the columns and values of the base table set. The semantics of derived tables correspond to those of views. A view is similar to a named derived table.

Derived tables allow you to specify a spool file composed of selected data from the base table set supporting the table expression in the FROM list of a query.

For information about derived tables, see Teradata Vantage™ - SQL Data Manipulation Language, B035-1146.

subquery
A SELECT request that defines the derived table.
You cannot specify the TOP n or TOP m PERCENT options (see “TOP n” and “TOP m PERCENT” later in this table, and Teradata Vantage™ - SQL Data Manipulation Language, B035-1146) in a subquery.
You cannot specify an ORDER BY clause in the subquery specification of a CREATE VIEW request.
derived_table_name
The name of a derived table.
For information about naming database objects, see Teradata Vantage™ - SQL Fundamentals, B035-1141.