Practical 6 (Saurabh)
Practical 6 (Saurabh)
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.
Output:
NAME – SAURABH SHARMA
SECTION – C1
ROLL NO. - 56