在学习的过程中,经常忘记hive的一些操作命令(例如启动,关闭),
特定把一些常用的操作命令給记下来
(1)启动hive
[atguigu@hadoop102 hive]$ bin/hive
(2)查看数据库
hive>show databases;
(3)打开默认数据库
hive>use default;
(4)显示default数据库中的表
hive>show tables;
(5)创建一张表
hive> create table student(id int, name string);
(6)显示数据库中有几张表
hive>show tables;
(7)查看表的结构
hive>desc student;
(8)向表中插入数据
hive> insert into student values(1000,"ss");
(9)查询表中数据
hive> select * from student;
(10)退出hive
hive> quit;