On-Machine jobs for Oracle databases

Source: Internet
Author: User

SelectDepartment_name,city,Count(*) fromDepartments D, employees E, Locations Lwheree.department_id=d.department_id andl.location_id=d.location_id andE.salary> +Group  byDepartment_name,city having Count(*)> 2;

 SelectFirst_Name||' '||last_name name,salary fromEmployeeswhereSalarybetween(Select avg(Salary) fromEmployeeswheredepartment_id= -) and(Select avg(Salary) fromEmployeeswheredepartment_id= the);

Select  || "' || last_name, salary, department_id  from  where salary=(selectmax from Employees);

Selectemployee_id,first_name,last_name,salary,commission_pct,salary*(1+NVL ( commission_pct,0)) totalincomefromorder by Totalincome;

Select  || "' || last_name  name  from  employees  where  (salary, department_id)        in (         selectmax from  Group  by department_id);

SelectEmployee_id,first_name||' '||last_name name,salary,department_id, (Select avg(Salary) fromEmployees EMPwhereemp.department_id=e.department_id) Avgsal fromEmployees EwhereSalary>(Select avg(Salary) fromEmployees EMPwhereemp.department_id=e.department_id)Order  bydepartment_id,employee_id;

SELECTDEPARTMENT_ID, Avgsal from       (SELECTROWNUM No, department_id, Avgsal from(SelectDEPARTMENT_ID,avg(Salary) Avgsal fromEmployeesGroup  bydepartment_idOrder  by avg(Salary))WHEREROWNUM<= 2)whereNo=2;

SelectEmployee_id,first_name||' '||last_name name,salary,department_id, (Select avg(Salary) fromEmployees EMPwhereemp.department_id=e.department_id) Avgsal fromEmployees EwhereSalary>(Select avg(Salary) fromEmployees EMPwhereemp.department_id=e.department_id)Order  bydepartment_id,employee_id;

Select  Level, employee_id, first_name, last_name, manager_id fromEmployees Start withFirst_Name='David'  andLast_Name='Austin'Connect byPrior manager_id=employee_idOrder   by  Level desc;

SelectDepartment_id,employee_id,first_name||' '||Last_name,salary,salrank from(SelectDepartment_id,employee_id,first_name,last_name,salary,dense_rank () Over(Partition bydepartment_idOrder  bySalarydesc) Salrank fromemployees)whereSalrank<=3Order  bydepartment_iddesc, Salrank;

On-Machine jobs for Oracle databases

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.