Free Online Certification Courses – Learn Today. Lead Tomorrow. › Forums › Apache Hadoop › Hive DDL commands :
- This topic has 2 replies, 1 voice, and was last updated 5 years, 7 months ago by DataFlair Team.
-
AuthorPosts
-
-
September 20, 2018 at 12:47 pm #4928DataFlair TeamSpectator
> DDL – Data Defination Language –> Used to define database schema.
1—> CREATE
2—> DROP
3—> ALTER
4—> SHOW
5—> DESCRIBE
6—> TRUNCATEMore details is as follows :
-
September 20, 2018 at 12:47 pm #4930DataFlair TeamSpectator
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 DataBut 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
-
September 20, 2018 at 12:48 pm #4931DataFlair TeamSpectator
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 WHEREwhere_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
-
-
AuthorPosts
- You must be logged in to reply to this topic.