Hive DDL commands :

Viewing 2 reply threads
  • Author
    Posts
    • #4928
      DataFlair TeamDataFlair Team
      Spectator

      > DDL – Data Defination Language –> Used to define database schema.

      1—> CREATE
      2—> DROP
      3—> ALTER
      4—> SHOW
      5—> DESCRIBE
      6—> TRUNCATE

      More details is as follows :

    • #4930
      DataFlair TeamDataFlair Team
      Spectator

      Basically, as above answer, there are several types of Hive DDL commands, we commonly use in Apache Hive. such as:

      – Create Database Statement
      – Hive Show Database
      – Drop database
      – Creating Hive Tables
      – Browse the table
      – Altering and Dropping Tables
      – Hive Select Data from Table
      – Hive Load Data

      But here is a link through which we can learn all these commands in detail; follow the link: Hive DDL Commands : Types of DDL Hive Commands

    • #4931
      DataFlair TeamDataFlair Team
      Spectator

      Hive DDL Commands

      In order to build and modify the tables and other objects in the database, we use Hive Data Definition Language (DDL) statements, such as:

      – Create Database Statement
      – Hive Show Database
      – Drop database
      – Creating Hive Tables
      – Browse the table
      – Altering and Dropping Tables
      – Hive Select Data from Table
      – Hive Load Data

      – Create Database Statement
      Basically, to create the new database in the Hive, we use Create Database Statement.

      Syntax-
      hive> CREATE SCHEMA userdb;

      hive> SHOW DATABASES;

      Or,

      CREATE DATABASE [IF NOT EXISTS] db_name;

      – Hive Show Database

      However, to display the databases present in Hive we use Hive Show Database command .

      Syntax-
      hive> DROP DATABASE IF EXISTS userdb;

      Or,

      SHOW DATABASES;

      – Drop database

      In order to delete the database, data and metadata for a table we use Drop drop database command.

      Syntax-
      hive> DROP DATABASE IF EXISTS userdb;

      Or,

      DROP DATABASE IF EXISTS db_name;

      – Hive Select Data from Table
      It helps to select the columns from a table this command is used.

      Syntax-
      SELECT [ALL | DISTINCT ] select_col, select_col FROM table WHERE

      where_condition [GROUP BY col_list] [HAVING having_con] [ORDER BY

      col_list][LIMIT number];

      – Hive Load Data
      This command is used to load the data into the Hive table.

      However, to learn all these commands along with their examples in detail, follow the link: Hive DDL Commands : Types of DDL Hive Commands

Viewing 2 reply threads
  • You must be logged in to reply to this topic.