栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Hive-创建库表测试

Hive-创建库表测试

drop database if exists `ods`;
create database `ods`;

use ods;
 
create table `dept`(
`deptno` int, 
`dname` varchar(14),
`loc` varchar(13)
) row format delimited fields terminated by 't' 
stored as textfile;
 
insert into dept values (10,'accounting','new york'),(20,'research','dallas'),(30,'sales','chicago'),(40,'operations','boston');

create table `emp` (
    `empno` int,
    `ename` varchar(10),  
    `job` varchar(9),  
    `mgr` int,  
    `hiredate` date,  
    `sal` float,  
    `comm` float,  
    `deptno` int
) row format delimited fields terminated by 't' 
stored as textfile;


insert into emp values (7369,'smith','clerk',7902,'1980-12-17',800,null,20),
(7499,'allen','salesman',7698,'1981-02-20',1600,300,30),
(7521,'ward','salesman',7698,'1981-02-22',1250,500,30),
(7566,'jones','manager',7839,'1981-04-02',2975,null,20),
(7654,'martin','salesman',7698,'1981-09-28',1250,1400,30),
(7698,'blake','manager',7839,'1981-05-01',2850,null,30),
(7782,'clark','manager',7839,'1981-06-09',2450,null,10),
(7788,'scott','analyst',7566,'1987-07-13',3000,null,20),
(7839,'king','president',null,'1981-11-07',5000,null,10),
(7844,'turner','salesman',7698,'1981-09-08',1500,0,30),
(7876,'adams','clerk',7788,'1987-07-13',1100,null,20),
(7900,'james','clerk',7698,'1981-12-03',950,null,30),
(7902,'ford','analyst',7566,'1981-12-03',3000,null,20),
(7934,'miller','clerk',7782,'1982-01-23',1300,null,10);

create table `salgrade` (  
    `grade` int, 
    `losal` int,  
    `hisal` int
) row format delimited fields terminated by 't' 
stored as textfile;


insert into salgrade values (1,700,1200),(2,1201,1400),(3,1401,2000),(4,2001,3000),(5,3001,9999);

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/354566.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号