0% found this document useful (0 votes)
29 views9 pages

Practical 6 (Saurabh)

Uploaded by

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

Practical 6 (Saurabh)

Uploaded by

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

NAME – SAURABH SHARMA

SECTION – C1
ROLL NO. - 56

Practical : 6

Problem statement 1: Display employee number, employee name, salary, salary increased
by 15% with label the column as new salary from emp table.
Problem statement 2 : Display ename, salary of the employee whose salary is greater or
equal to 3000.
Problem statement 3: List the details of employee who earn more commission than salary.
Problem statement 4 : List the details of who have four letter name.
Problem statement 5: Display the name of employee whose name has “T” as the last
alphabet.
Steps: In sql command prompt type –
1. select empno ,ename, salary, salary+salary*0.15 as newSalary from emp;
2. select ename, salary from emp where salary >=3000;
3. select *from emp where comm > salary;
4. select* from emp where ename like ‘____’;
5. select * from emp where ename like ‘&t’;

Output:
NAME – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56
NAME – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56

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 statement8: 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.
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.

St
Steps: In sql command prompt type –
1. select *from emp where job=’clerk’ and department is null;
2. select*from emp where mgr is null;
3. select*from emp where job=’manager’ and salary<3000;
4. select*from emp where salary between 1000 and 2000;

Output:
NAME – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56
NAME – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56

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 view.

Steps: In sql command prompt type –


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 – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56

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;
NAME – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56
NAME – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56
NAME – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56

You might also like