You use DDL statements to define the structure and instances of a database.
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. |
| DROP | Removes a database object. |
| ALTER | Changes a table, column, referential constraint, trigger, or index. |
| ALTER PROCEDURE | Recompiles an external stored procedure. |
| MODIFY | Changes a database or user definition. |
| RENAME | Changes the name of a table, trigger, view, stored procedure, or macro. |
| REPLACE | Replaces a macro. |
| SET | Specifies time zone, collation, or character set for a session. |
| COLLECT | Collects optimizer or QCD statistics on a column, group of columns, or 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 Teradata Vantage⢠- Data Dictionary, B035-1092.