TheDeveloperBlog.com

Home | Contact Us

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

Hive Create Database

Hive Create 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 - Create Database

In Hive, the database is considered as a catalog or namespace of tables. So, we can maintain multiple tables within a database where a unique name is assigned to each table. Hive also provides a default database with a name default.

  • Initially, we check the default database provided by Hive. So, to check the list of existing databases, follow the below command: -
hive> show databases;

Hive Create Database

Here, we can see the existence of a default database provided by Hive.

  • Let's create a new database by using the following command: -
hive> create database demo;

Hive Create Database

So, a new database is created.

  • Let's check the existence of a newly created database.
hive> show databases;

Hive Create Database
  • Each database must contain a unique name. If we create two databases with the same name, the following error generates: -
Hive Create Database
  • If we want to suppress the warning generated by Hive on creating the database with the same name, follow the below command: -
hive> create a database if not exists demo;

Hive Create Database
  • Hive also allows assigning properties with the database in the form of key-value pair.
hive>create the database demo
		>WITH DBPROPERTIES ('creator' = 'Gaurav Chawla', 'date' = '2019-06-03'); 

Hive Create Database
  • Let's retrieve the information associated with the database.
hive> describe database extended demo;

Hive Create Database
Next TopicHive Drop Database




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