forked from raveendratal/PysparkRaveendra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emp_script.sql
24 lines (24 loc) · 1.29 KB
/
emp_script.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- employee and department tables script
DROP TABLE IF EXISTS emp;
DROP TABLE IF EXISTS dept;
CREATE TABLE IF NOT EXISTS `emp`(`EMPNO` INT,`ENAME` STRING,`JOB` STRING,`MGR` STRING,`HIREDATE` DATE,`SAL` INT,`COMM` STRING,`DEPTNO` INT) USING delta;
CREATE TABLE IF NOT EXISTS `dept`( `Deptno` INT, `Dname` STRING, `Loc` STRING) USING delta;
INSERT INTO emp VALUES (7369,'SMITH','CLERK',7902,'1980-10-12',800,NULL,20),
(7499,'ALLEN','SALESMAN',7698,'1981-10-02',1600,300,30),
(7521,'WARD','SALESMAN',7698,'1981-12-02',1250,500,30),
(7566,'JONES','MANAGER',7839,'1981-02-04',2975,NULL,20),
(7654,'MARTIN','SALESMAN',7698,'1981-08-09',1250,1400,30),
(7698,'SGR','MANAGER',7839,'1981-01-05',2850,NULL,30),
(7782,'RAVI','MANAGER',7839,'1981-09-06',2450,NULL,10),
(7788,'SCOTT','ANALYST',7566,'1987-09-04',3000,NULL,20),
(7839,'KING','PRESIDENT',NULL,'1981-07-11',5000,NULL,10),
(7844,'TURNER','SALESMAN',7698,'1981-08-09',1500,0,30),
(7876,'ADAMS','CLERK',7788,'1987-03-05',1100,NULL,20),
(7900,'JAMES','CLERK',7698,'1981-03-12',950,NULL,30),
(7902,'FORD','ANALYST',7566,'1981-03-12',3000,NULL,20),
(7934,'MILLER','CLERK',7782,'1982-03-01',1300,NULL,10),
(1234,'SEKHAR','doctor',7777,NULL,667,78,50);
INSERT INTO DEPT VALUES (10,'ACCOUNTING','NEW YORK'),
(20,'RESEARCH','DALLAS'),
(30,'SALES','CHICAGO'),
(40,'OPERATIONS','BOSTON');