Hive Create DataBase

Hive CREATE DATABASE is used to create DataBase in hive, each Database in hive will have set of tables like RDBMS Databases and Tables.

Before creating any table we need to first create the dataBase and then we need to create the table.

How to Create DataBase in Hive?

Syntax:

Example:

Let us create the Hive Data Base called StudentDataBase.


How to show the tables inside Hive Database?

we will list down all the databases using show command.


How to Drop Database in Hive?

Be aware of this drop command before using the DROP command with Hive Database or Hive table, because it will drop the entire table or Database, if the database has some tables and if you want to remove, you have to first drop all the tables it has and then we need issue drop database command, otherwise we will get the following error.

if the Database is empty then we can drop it using drop command.