0% found this document useful (0 votes)
6 views

Neerajsingh dbms6

Uploaded by

sgusain483
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Neerajsingh dbms6

Uploaded by

sgusain483
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

NAME : NEERAJ SINGH

ROLL NO : 37
SECTION : C1

PRACTICAL : 06

PROBLEM STATEMENT 1: Display emp no., emp name, salary, salary increase by 15% from
emp table, label the column as new salary.
PROBLEM STATEMENT 2: Display ename and salary of the employee whose salary >= 3000;

STEPS :

• Write a command select emp no, ename, salary, salary+salary +*15/100 as new
salary from employee;
• Write a command Select ename , salary from employee where salary >=3000;

OUTPUT :
NAME : NEERAJ SINGH
ROLL NO : 37
SECTION : C1

PROBLEM STATEMENT 3 : List the detail of employee who earn more commission their salary.
PROBLEM STATEMENT 4 : List the detail of employee who have 4 letter name.
PROBLEM STATEMENT 5 : List the detail of employee whose name has ‘T’ as the last alphabet.

STEPS :

• Select * from employee where commission > salary;


• Select * from employee where ename like ‘ ’;
• Select * from employee where ename like ‘ % t ‘;

OUTPUT :
NAME : NEERAJ SINGH
ROLL NO : 37
SECTION : C1

PROBLEM STATEMENT 6 : Display the name of the employee who is having “L” as any
alphabet.
PROBLEM STATEMENT 7 : Display the emp no, e name, and dept no who are not getting any
commission.
PROBLEM STATEMENT 8: List the detail of all clerk who have not been assigned to any department.
PROBLEM STATEMENT 9 : List the detail of all employees who do not have a manager.

Steps: In sql command prompt type –


1. select* from emp where ename like ’%l%’;
2. select empno, ename from emp where comm is null;
3. select *from emp where job=’clerk’ and department is null;
4. select*from emp where mgr is nul;

OUTPUT:
NAME : NEERAJ SINGH
ROLL NO : 37
SECTION : C1

PROBLEM STATEMENT 10: Display the name of all the employees whose name starts “M as the
first letter and L as the third letter”.

PROBLEM STATEMENT 11: Display the detail of all manager whose salary less than 3000.

PROBLEM STATEMENT 12: List the detail of all employee whose salary lies between 1000 &

2000.

STEPS :

1. select * from employee where ename like ‘M_l%’;


1. select*from emp where salary between 1000 and 2000 ;
2. select*from emp where job=’manager’ and salary ;

Output:
NAME : NEERAJ SINGH
ROLL NO : 37
SECTION : C1

PROBLEM STATEMENT 13: Display the emp no, e name, job of the employee which do not belong to
any department.
PROBLEM STATEMENT 14 : Create a view named v1 and load empno and ename of all employees
whose job is manager or salesman. Display the data of view table.

STEPS:

1. select ename , empno, job from emp where department is null;


2. create view v1 as select empno, ename from emp where job=’manager’ or job=’salesman’;
3. select *from v1;
OUTPUT:
NAME : NEERAJ SINGH
ROLL NO : 37
SECTION : C1

PROBLEM STATEMENT 15: Display unique dept no in the table emp.


PROBLEM STATEMENT 16 : Display the job of employee ‘7900’ in the format- “ ename is a job”.
PROBLEM STATEMENT 17 : Display following format- “(ename) earns (salary) montly and working as
(job)”.

STEPS : In sql command prompt type –


1. select distinct( deptno) from emp;
2. select ename ||’ ‘ || ‘is a ‘ ||’ ‘||job from emp;
3. select ename ||’ ‘|| ‘ earns ‘ ||’ ‘|| salary ||’ ‘|| ‘ monthly and working as ‘ ||’ ‘|| job from emp;
OUTPUT:

You might also like