FOR FREE YEAR SOLVED

SQL ASSINGMENT 6 WITH SOLUTION

Back to Programming

Description

Employee (EMPNO, ENAME, JOB, MGR, SALARY, DEPTNO, COMM)


a)     Edit the commission of JONES to 1000.

b)     Retrieve empno and ename column of employee table.

c)     Give list of ename and their job spec who are working in deptno 20.

d)     Find list of emp whose empno is greater than manager no.

e)     Find all manager not in deptno 20.

f)      Display ename and comm * 2 and rename it to mod-comm.


CREATE Table EMPLOYEE:

CREATE TABLE EMPLOYEE (

EMPNO

NUMBER(5) PRIMARY KEY,

ENAME VARCHAR(50),

JOBVARCHAR(25),

MGRNUMBER(5) ,

SALARY NUMBER(10),

DEPTNO NUMBER(5),

COMM NUMBER(5) ); 


Table EMPLOYEE is created.


EMPLOYEE 




Insert the values in the table "EMPLOYEE":

INSERT INTO Employee VALUES(101, 'JONES’, ‘MANAGER’,101,10000,20,500)

INSERT INTO Employee VALUES(106,'RAM’, ‘STAFF’,50,12000,19,750)

INSERT INTO Employee VALUES(110, 'BHABESH’, ‘MANAGER’,110,10000,20,200)

INSERT INTO Employee VALUES(102, 'KAPIL’, ‘STAFF’,205,16000,20,900)

INSERT INTO Employee VALUES(105,'SHYAM’, ‘MANAGER’,105,17500,15,500) ;



Output:

5 rows created


Code