创建一个名为 student 的表,该表包含以下列族: info:包含学生姓名和出生日期。 score:包含语文、数学和英语三科成绩。 2.向student表中插入至少5条学生记录,每条记录应包含学生姓名、出生日期和三科成绩。
时间: 2024-03-06 22:51:25 浏览: 18
好的,您可以使用HBase Shell命令行界面来完成这个任务。请按照以下步骤操作:
1. 打开终端,使用以下命令进入HBase Shell:
```
hbase shell
```
2. 创建表student并定义列族info和score:
```
create 'student', {NAME => 'info'}, {NAME => 'score'}
```
3. 插入学生记录,例如:
```
put 'student', '1001', 'info:name', '张三'
put 'student', '1001', 'info:birthday', '1998-01-01'
put 'student', '1001', 'score:chinese', '90'
put 'student', '1001', 'score:math', '80'
put 'student', '1001', 'score:english', '85'
put 'student', '1002', 'info:name', '李四'
put 'student', '1002', 'info:birthday', '1999-02-02'
put 'student', '1002', 'score:chinese', '92'
put 'student', '1002', 'score:math', '87'
put 'student', '1002', 'score:english', '88'
put 'student', '1003', 'info:name', '王五'
put 'student', '1003', 'info:birthday', '1997-03-03'
put 'student', '1003', 'score:chinese', '85'
put 'student', '1003', 'score:math', '89'
put 'student', '1003', 'score:english', '90'
put 'student', '1004', 'info:name', '赵六'
put 'student', '1004', 'info:birthday', '1996-04-04'
put 'student', '1004', 'score:chinese', '88'
put 'student', '1004', 'score:math', '92'
put 'student', '1004', 'score:english', '93'
put 'student', '1005', 'info:name', '钱七'
put 'student', '1005', 'info:birthday', '1995-05-05'
put 'student', '1005', 'score:chinese', '90'
put 'student', '1005', 'score:math', '90'
put 'student', '1005', 'score:english', '92'
```
4. 插入完成后,您可以使用以下命令来查看表student中的所有记录:
```
scan 'student'
```
这样您就成功地创建了表student并插入了五条学生记录。