Creating Database in Hive and Switching to the Database


Let us undestand how to create databases in Hive.

  • Make a habit of reviewing Language Manual.
  • We can create database using CREATE DATABASE Command.
  • For e. g.: CREATE DATABASE training_retail;
  • If the database exists it will fail. If you want to ignore with out throwing error you can use IF NOT EXISTS
  • e. g.: CREATE DATABASE IF NOT EXISTS training_retail;
  • Hive is multi tenant database. To switch to a database, you can use USE Command. e. g.: USE training_retail;

Practice hive on state of the art Big Data cluster -
You can sign up for our courses on Udemy using $10 coupons - Udemy Coupons - Big Data Courses