Freshers Aptitude technical questions
Freshers Job Alert
Bookmark and Share

•  SELECT Statements

•  statement selects the name, job, salary and department number of all employees except purchasing clerks 'PU_CLERK' from department number 30

 

SELECT last_name, job_id, salary, department_id FROM employees

WHERE NOT (job_id = 'PU_CLERK' AND department_id = 30);

 

•  Query uses a self join to return the name of each employee along with the name of the employee's manager (Table Stru: emp_id, emp_name, manager_id à manager_id maps to emp_id)

 

SELECT e1.last_name||' works for '||e2.last_name "Employees and Their Managers" FROM employees e1, employees e2 WHERE e1.manager_id = e2.employee_id