![]() ![]() Display ename, job, dname, his manager name, his grade and display output department number wise?ġ46. Find out the number of employees whose salary is greater than their managers salary?ġ45. Display also employees who are without managers?ġ44. Display those department where no employee working?ġ43. Display the details of those employees who are in sales department and grade is 3ġ42. Display the details of those employees who do not have any person working under himġ41. Display those employees whose manager name is Jonesġ40. ![]() Display employees whose salary is less than his manager but more than salary of other managers?ġ39. ![]() Display name and salary of FORD if his salary is equal to hisal of his grade?ġ38. Display the employee names who are working in CHICAGOġ37. Display employee names who are working in ACCOUNTING departmentġ36. Display those employees whose manager name is JONES and also display their manager name?ġ35. Display employee name ,job,deptname,loc for all who are working as manager?ġ34. Delete employees joined company before 31-Dec-82 while their Location is New York or Chicago?ġ33. Display ENAME, GRADE (deptno 10 or 30) (grade is not 4) (joined company before 31-DEC-82)ġ32. Display those employees who are not working under any Managerġ31. Display those employees who are working in the same dept where his manager is workġ30. Display those employees whose salary is greater than his managers salaryġ29. Display ENAME, DNAME, SAL and COMM for employees with salary between 2000 to 5000 and location is Chicagoġ28. Display ename who are working in sales departmentġ27. Display all employees with their department namesġ26. Group by department)) where rnk=1 Reply Deleteġ25. Select department,cnt from (select department,rank() over(order by cnt desc) as rnk,cnt from (select count(distinct manager) as cnt ,department from employee Select mgr from (select e1.id as mgr,e2.id as id,e1.doj as mdoj, e2.doj as edoj from employee e1ħ.department with most managers and how many? Select mgr from (select mgr,rank() over( order by cnt desc) as rnk from (select mgr,count(id) as cnt from (select e1.id as mgr,e2.id as id from employee e1Ħ.list managers who joined after the reportees Group by to_char(doj,'mm'))) where rnk=1 Ĥ.what is the experience gap between the first employee and the latest? Select dt from (select dt,rank() over(order by cnt desc) as rnk from (select to_char(doj,'mm') as dt ,count(*) as cnt from employee Select mgr from (select e1.id as mgr ,e2.id as id from employee e1 Where id not in (select manager from employee) Select id,manager,to_char(doj,'dd-mon-yyyy') from employee ġ. Adding the answers too!!Ĭreate table employee(id int, name varchar(50), department varchar(50), manager int, doj date) In this case, the Index will be used because EmpId and EmpFirstName are primary columns.Īdding one set of questions I faced during oracle interview. If the given two columns are secondary index columns then the index will not invoke, but if the given 2 columns contain the primary index(first column while creating index) then the index will invoke. SELECT * FROM Employee WHERE EmpId = 2 and EmpFirstName = 'Radhe' Question 14: You have a composite index of three columns, and you only provide the value of two columns in the WHERE clause of a select query? Will Index be used for this operation? For example, if Index is on EmpId, EmpFirstName, and EmpSecondName and you write a query like To solve that, instead of using the inner join, just use the left outer join, this will also include employees without managers. One follow-up is to modify this query to include employees which don't have a manager. ![]() This will show employee name and manager name in two columns like In Self Join, you can join two instances of the same table to find out additional details as shown below Answer: You need to know about self-join to solve this problem. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |