This topic contains 0 replies, has 1 voice, and was last updated by  Avikumar 3 years, 6 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #1268

    Avikumar
    Participant

    Drop Database Statement:-

    Drop Database is a statement that drops all the tables and deletes the database. Its syntax is as follows:

    DROP DATABASE StatementDROP (DATABASE|SCHEMA) [IF EXISTS] database_name
    [RESTRICT|CASCADE];

    The following queries are used to drop a database. Let us assume that the database name is userdb.
    hive> DROP DATABASE IF EXISTS userdb;

    The following query drops the database using CASCADE. It means dropping respective tables before dropping the database.

    hive> DROP DATABASE IF EXISTS userdb CASCADE;
    The following query drops the database using SCHEMA.

    hive> DROP SCHEMA userdb;

Viewing 1 post (of 1 total)

The forum ‘General Discussion’ is closed to new topics and replies.