Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
23 views2 pages

Oracle Tables

The document contains SQL commands to create four tables: EMP, DEPT, SALGRADE, and BONUS, each with specified columns and data types. It also includes a series of INSERT statements to populate the EMP and DEPT tables with employee and department data, as well as salary grades in the SALGRADE table. The data includes various employee details such as names, job titles, salaries, and department numbers.

Uploaded by

Scz Mcb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Oracle Tables

The document contains SQL commands to create four tables: EMP, DEPT, SALGRADE, and BONUS, each with specified columns and data types. It also includes a series of INSERT statements to populate the EMP and DEPT tables with employee and department data, as well as salary grades in the SALGRADE table. The data includes various employee details such as names, job titles, salaries, and department numbers.

Uploaded by

Scz Mcb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATE TABLE EMP

(
EMPNO NUMBER(4) NOT NULL,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2)
);

CREATE TABLE DEPT


(
DEPTNO NUMBER(2) NOT NULL,
DNAME VARCHAR2(14),
LOC VARCHAR2(13)
);

CREATE TABLE SALGRADE


(
GRADE NUMBER,
LOSAL NUMBER,
HISAL NUMBER
);

CREATE TABLE BONUS


(
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
SAL NUMBER,
COMM NUMBER
);

Insert into Emp values (7369,'SMITH','CLERK' ,7902,'17-DEC-80',800,null,20);


Insert into Emp values (7499, 'ALLEN','SALESMAN',7698,'20-FEB-
81',1600,300,30);
Insert into Emp values (7521, 'WARD' ,'SALESMAN',7698,'22-FEB-
81',1250,500,30);
Insert into Emp values (7566, 'JONES','MANAGER',7839 ,'02-APR-
81',2975,null,20);
Insert into Emp values (7654, 'MARTIN','SALESMAN',7698,'28-SEP-
81',1250,1400,30);
Insert into Emp values (7698, 'BLAKE','MANAGER', 7839 ,'01-MAY-
81',2850,null,30);
Insert into Emp values (7782, 'CLARK','MANAGER',7839, '09-JUN-
81',2450,null,10);
Insert into Emp values (7788, 'SCOTT','ANALYST',7566,'19-APR-
87',3000 ,null,20);
Insert into Emp values (7839, 'KING','PRESIDENT',null,'17-NOV-81',5000, null,
10);
Insert into Emp values (7844, 'TURNER','SALESMAN',7698,'08-SEP-
81',1500,0,30);
Insert into Emp values (7876, 'ADAMS','CLERK',7788,'23-MAY-87',1100,null,20);
Insert into Emp values (7900, 'JAMES','CLERK',7698,'03-DEC-81',950,null,30);
Insert into Emp values (7902, 'FORD','ANALYST',7566,'03-DEC-
81',3000,null,20);
Insert into Emp values (7934,'MILLER','CLERK',7782,'23-JAN-82',1300,null,10);

Insert into dept values ( 10 ,'ACCOUNTING','NEW YORK');


Insert into dept values (20, 'RESEARCH','DALLAS');
Insert into dept values (30,'SALES','CHICAGO');
Insert into dept values(40,'OPERATIONS','BOSTON');

Insert into salgrade values(1,700,1200);


Insert into salgrade values(2,1201,1400);
Insert into salgrade values(3,1401,2000);
Insert into salgrade values(4,2001,3000);
Insert into salgrade values(5,3001,9999);

You might also like