15.00 - Data Definition Language - Teradata Database

Teradata Database SQL Fundamentals

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1141-015K

Data Definition Language

The SQL Data Definition Language (DDL) is a subset of the SQL language and consists of all SQL statements that support the definition of database objects.

Purpose

Data definition language statements perform the following functions:

  • Create, drop, rename, alter, modify, and replace database objects
  • Comment on database objects
  • Collect statistics on a column set or index
  • Establish a default database
  • Set a different collation sequence, account priority, DateForm, time zone, and database for the session
  • Set roles
  • Set the query band for a session or transaction
  • Begin and end logging
  • Enable and disable online archiving for all tables in a database or a specific set of tables
  • Rules on Entering DDL Statements

    A DDL statement can be entered as:

  • A single-statement request.
  • The solitary statement, or the last statement, in an explicit transaction (in Teradata mode, one or more requests enclosed by user‑supplied BEGIN TRANSACTION and END TRANSACTION statement, or in ANSI mode, one or more requests ending with the COMMIT keyword).
  • The solitary statement in a macro.
  • DDL statements cannot be entered as part of a multistatement request.

    Successful execution of a DDL statement automatically creates and updates entries in the Data Dictionary.

    SQL DDL Statements

    For detailed information about the function, syntax, and usage of Teradata SQL Data Definition statements, see SQL Data Definition Language.