COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
ename ____ ALLEN
|
|
ALLEN
|
|
Error
|
|
None of the above
|
Detailed explanation-1: -having count() = (select max(count(*) ) from emp group by deptno); Display the emps whose manager name is jones. A) select * from emp where mgr in (select empno from emp where ename = ‘JONES’); (OR) B) select * from emp where mgr = (select empno from emp where ename = ‘JONES’);
Detailed explanation-2: -Here is a way to do this task using dense rank() function. Query : select * from( select ename, sal, dense rank() over(order by sal desc)r from Employee) where r=&n; To find to the 2nd highest sal set n = 2 To find 3rd highest sal set n = 3 and so on.
Detailed explanation-3: -Which of the below SELECT statement is used to select all columns of EMP table? Answer: C. The character ‘*’ is used to select all the columns of the table.
Detailed explanation-4: -Select the table EMPLOYEES. In the right frame of the Oracle SQL Developer window, in the Columns pane, a list of all columns of this table appears. To the right of each column are its properties-name, data type, and so on. (To see all column properties, move the horizontal scroll bar to the right.)