天天看點

hive基本操作建表啥的 *

(1)啟動hive

/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)查詢表中資料

(10)退出hive