TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Hive Drop Database

Hive Drop Database with tutorial, introduction, environment setup, first app hello world, state, props, flexbox, height and width, listview, scrollview, images, buttons, router, etc.

<< Back to HIVE

Hive - Drop Database

In this section, we will see various ways to drop the existing database.

  • Let's check the list of existing databases by using the following command: -
hive> show databases;

Hive Drop Database
  • Now, drop the database by using the following command.
hive> drop database demo;

Hive Drop Database
  • Let's check whether the database is dropped or not.
hive> show databases;

Hive Drop Database

As we can see, the database demo is not present in the list. Hence, the database is dropped successfully.

  • If we try to drop the database that doesn't exist, the following error generates:
Hive Drop Database
  • However, if we want to suppress the warning generated by Hive on creating the database with the same name, follow the below command:-
hive> drop database if exists demo;
Hive Drop Database
  • In Hive, it is not allowed to drop the database that contains the tables directly. In such a case, we can drop the database either by dropping tables first or use Cascade keyword with the command.
  • Let's see the cascade command used to drop the database:-
hive> drop database if exists demo cascade;

This command automatically drops the tables present in the database first.

Next TopicHive Create Table




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf