what is subquery? : Sql dba


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More SQL PLSQL Interview Questions

What is the importance of sqlcode and sqlerrm?

0 Answers  


How to download oracle sql developer?

0 Answers  


A table was given with 3 columns like Manager id,Manager Name and Employee name. Question was to create hierarchy.

2 Answers   TCS,


what are aggregate and scalar functions? : Sql dba

0 Answers  


how many ways we can we find the current date using mysql? : Sql dba

0 Answers  






how to check the 3rd max salary from an employee table? One of the queries used is as follows: select sal from emp a where 3=(select count(distinct(sal)) from emp b where a.sal<=b.sal). Here in the sub query "select count(distinct(sal)) from emp b where a.sal<=b.sal" or "select count(distinct(sal)) from emp b where a.sal=b.sal" should reveal the same number of rows is in't it? Can any one here please explain me how is this query working perfectly. However, there is another query to get the 3rd highest of salaries of employees that logic I can understand. Pls find the query below. "select min(salary) from emp where salary in(select distinct top 3 salary from emp order by salary desc)" Please explain me how "select sal from emp a where 3=(select count(distinct(sal)) from emp b where a.sal<=b.sal)" works source:http://www.allinterview.com/showanswers/33264.html. Thanks in advance Regards, Karthik.

4 Answers  


Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?

0 Answers  


How many types of indexes are there in sql?

0 Answers  


How to avoid duplicate records in a query?

0 Answers  


what is the difference between blob and text? : Sql dba

0 Answers  


Hello All, Could any well write a query for the following scenario. Account(table name) No Name Amount 1 ABCD 2000.00 2 DEFG -2000.00 3 GHIJ 3000.50 4 JKLM 4000.00 5 MNOP 6000.00 O/p Should be in this format No Name Credit Debit 1 ABCD 2000.00 0 2 DEFG 0 -2000.00 3 GHIJ 3000.50 4 JKLM 0 -4000.00 5 MNOP 6000.00 o could any one give appropriate query for this Thnks in Advance

5 Answers   Target,


what are the system privileges that are required by a schema owner (user) to create a trigger on a table?

0 Answers  


Categories