hive 2、将下列数据使用基本插入方式插入到表中,并查看表中数据。 insert into table employess41_table values ("Lilith Hardy",30,6000,50,"Finance Department"), ("Byron Green",36,5000,25,"Personnel Department"), ("Yvette Ward",21,4500,15.5,""), ("Arlen Esther",28,8000,20,"Finance Department"), ("Rupert Gold",39,10000,66,"R&D Department"), ("Deborah Madge",41,6500,0,"R&D Department"), ("Tim Springhall",22,6000,36.5,"R&D Department"), ("Olga Belloc",36,5600,10,"Sales Department"), ("Bruno Wallis",43,6700,0,"Personnel Department"), ("Flora Dan",27,4000,35,"Sales Department");
时间: 2023-07-19 16:04:32 浏览: 176
spark或mr引擎插入的数据,hive表查询数据为0
首先需要创建一个名为 employess41_table 的表,该表包含五个列:name,age,salary,working_years 和 department。
可以使用以下语句创建表:
```
CREATE TABLE employess41_table (
name STRING,
age INT,
salary INT,
working_years FLOAT,
department STRING
);
```
接下来,使用基本插入方式将数据插入到 employess41_table 表中:
```
INSERT INTO TABLE employess41_table VALUES
("Lilith Hardy",30,6000,50,"Finance Department"),
("Byron Green",36,5000,25,"Personnel Department"),
("Yvette Ward",21,4500,15.5,""),
("Arlen Esther",28,8000,20,"Finance Department"),
("Rupert Gold",39,10000,66,"R&D Department"),
("Deborah Madge",41,6500,0,"R&D Department"),
("Tim Springhall",22,6000,36.5,"R&D Department"),
("Olga Belloc",36,5600,10,"Sales Department"),
("Bruno Wallis",43,6700,0,"Personnel Department"),
("Flora Dan",27,4000,35,"Sales Department");
```
最后,可以使用 SELECT 语句确认数据已成功插入:
```
SELECT * FROM employess41_table;
```
阅读全文