Data Definition Language Statements - Advanced SQL Engine - Teradata Database

Database Introduction

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qia1556235689628.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1091
lifecycle
previous
Product Category
Teradata Vantageā„¢

You use DDL statements to define the structure and instances of a database. DDL provides statements for the definition and description of database objects.

The following table lists some basic DDL statements. The list is not exhaustive.

Statement Action
CREATE Defines a new database object, such as a database, user, table, view, trigger, index, macro, stored procedure, user-defined type, user-defined function, or user-defined macro, depending on the object of the CREATE request.
DROP Removes a database object, such as a database, user, table, view, trigger, index, macro, stored procedure, user-defined type, user-defined function, user-defined method, depending on the object of the DROP request.
ALTER Changes, for example, a table, column, referential constraint, trigger, or index.
ALTER PROCEDURE Recompiles an external stored procedure.
MODIFY Changes a database or user definition.
RENAME Changes, for example, the names of tables, triggers, views, stored procedures, and macros.
REPLACE Replaces, for example, macros, triggers, stored procedures, and views
SET Specifies, for example, time zones, the collation or character set for a session.
COLLECT Collects optimizer or QCD statistics on, for example, a column, group of columns, index.
DATABASE Specifies a default database.
COMMENT Inserts or retrieves a text comment for a database object.

Successful execution of a DDL statement automatically creates, updates, or removes entries in the Data Dictionary. For information about the contents of the Data Dictionary, see The Data Dictionary.