Академический Документы
Профессиональный Документы
Культура Документы
1- Show Annual Income of Manager having department number 10, 20 and 30 or show those
supervisor whose salary is between 1000 and 5000.
2- Give names as “Employee Names”, jobs as “Employee Job”, managers as “Employee Managers” and
grade as “Grade” of those employees who have department number in between 10 and 30 and the
only the first letter of name must be Capital.
select initcap(ename) as "Employee Names", job as "Employee Job", mgr as "Employee Managers",
grade as "Grade"
from emp, dept, salgrade
where dept.deptno>10 and dept.deptno < 30
and emp.deptno = dept.deptno
and (emp.sal>losal and emp.sal<hisal)
select ename as "Employee Names", hiredate as "Hiring Date", empno as "Employee Number", dname
as "Department Name", job,mgr
6- Give names of employees as “Employee Name”, hire date as “Hiring Date”, location as “Location”,
number of characters in location as “Length of Characters in Location” and the 4th letter of name of
employee as “Employee.
select ename as "Employee Name", hiredate as "Hiring Date", loc as "Location", length(loc) as
"Length of Location", substr(ename,4,1) as "Employee"
from emp, dept
where emp.deptno = dept.deptno
7- Give location of employees as “Location”, high salary of grade as “High Salary”, low salary of grade
as “Low Salary” of all employees but both salaries should be in 8 digits long, apply left padding with
‘*’ to complete 8 digits.
select ename, loc as "Location", lpad(hisal,8,'*') as "High Salaray", lpad(losal,8,'*') as "Low Salary"
from emp, dept, salgrade
where emp.deptno = dept.deptno
and (emp.sal>losal and emp.sal<hisal)
8- Give current date as “Today Date”, hire date as “Hiring Date”, the total number of weeks from hire
date as “Total Weeks” the total number of months from hire date as “Total Months” of all
employees.
from emp
9- Give names as “Employee Names”, hire date as “Hiring Date”, add 8 months in every hire date of
employee as “8 Months Added” and the date of the first Monday after hiring date as “First Working
Week” of all employees.
10- Give jobs as “Jobs”, names as “Employee Names”, location as “Department Location” and grade as
“Salary Grade” of all employees who have department number multiple of 10.
select job as "Jobs", ename as "Employee Names", loc as "Department Location", grade as "Salaray
Grade"
from emp, dept, salgrade
where emp.deptno = dept.deptno * 10
11- Give names and salary of those employees who have ‘A’ in their names, work in department
number 10 and 20 and have salary greater than 2500.
12- Give hire date as “Original Hire Date”, hire date in format ‘22 November 2014’ as “Date Format.1”
of all employees whose commission is not null.
select ename as "Employee Names", job as "Employee Job", mgr as "Supervised Manager", loc as
"Department Location", emp.deptno as "Department Number", sal as "Incremented Salary"