Teradata DELETE DATABASE

The DELETE DATABASE statement is used to remove all the objects like tables, views, macros, stored procedures, user-defined functions, etc. from a Teradata database.

You need to have DROP privileges to the database from which you want to delete the database objects.

Teradata DELETE DATABASE Syntax

The syntax of the Teradata DELETE DATABASE is as follows.

DELETE DATABASE database_name [ALL];

Here,

  • First, specify the name of the database after the DELETE DATABASE keywords.
  • Second, optionally specify ALL keywords to delete all the objects including the materialized view.

Teradata DELETE DATABASE Example

The following statement deletes all the objects from the TUTORIALSBOOK database.

DELETE DATABASE TUTORIALSBOOK;

Output:

DELETE DATABASE TUTORIALSBOOK;

*** Database’s objects have been dropped.
*** Total elapsed time was 1 second.

To remove the database completely including the database structure from the data dictionary you can use the Teradata DROP DATABASE statement.

Please get connected & share!

Advertisement