(一)数据库
创建数据库:create database if not exists financials;
显示数据库:show databases;
show databases like "h.*"
设置位置:create database financials location "my/preferred/directory"
设置评论:create database financials comment "hold all financial tables"
增加信息:create database financials with dbproperties("creator"="mark mon","date"="2012-01-02")
使用数据库:use financials
删除数据库:drop database if exists financials
drop database if exists financials cascade;(hive先自行删除数据库里的表)
drop database if exists financials restrict;(默认,必须先删除完数据库里的表,才可以删除数据库)
修改数据库:alter database financials set dbproperties("edited_by"="joe")