HBase Shell数据库操作
- 数据库表创建
 - HBase Shell 数据访问操作
 - HBASE 数据访问程序设计
 
数据库表创建

创建学生表(Student)
./bin/hbase shellcreate \'Student\',\'S_ID\',\'S_Name\',\'S_Sex\',\'S_Age\'

创建课程表(Course)
create \'Course\',\'C_ID\',\'C_Name\',\'C_Credit\'

创建选课表(Selected_Course)
create \'Selected_Course\',\'SC_ID\',\'C_ID\',\'SC_Score\'

查看已创建的表
list

HBase Shell 数据访问操作
学生表(Student)添加3条记录
注意:每一行的数据,需要每一列添加,否则会报错
显示学生表(Student)记录
scan \'Student\'

课程表(Course)添加3条记录
显示课程表(Course)记录
scan \'Course\'

选课表(Selected_Course)添加4条记录
显示选课表(Selected_Course)记录
scan \'Selected_Course\'

HBASE 数据访问程序设计
HBase Shell命令显示学生表(Student)记录
scan \'Student\'

HBase Shell命令从课程表中查询(get)任意一条数据
get \'Course\',\'c0001\'

使用HBase Shell命令将选课表(Selected_Course)删除
disable \'Selected_Course\'drop \'Selected_Course\'list

HBase Shell数据库操作到此就结束了。如果博客中有问题,欢迎各位大神们指点迷津鸭。
爱站程序员基地


