.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> Sql Server >> Post New Question Subscribe to Interview Questions

What is a sub query?

Posted By :Karthikeyan Anbarasan     Posted Date :January 07, 2011    Points :15   Category :Sql Server 
? It is a SELECT statement that is nested within another T-SQL statement.
? A subquery SELECT statement if executed independently of the T-SQL statement, in which it is nested, will return a resultset. Meaning a subquery SELECT statement can standalone and is not depended on the statement in which it is nested.
? A subquery SELECT statement can return any number of values, and can be found in, the column list of a SELECT statement, a FROM, GROUP BY, HAVING, and/or ORDER BY clauses of a T-SQL statement.
? A Subquery can also be used as a parameter to a function call. Basically a subquery can be used anywhere an expression can be used.


You can also find related Interview Question to What is a sub query?  below: 

What is Query evaluation engine?

  
It executes low-level instruction generated by compiler. (More...)

What is Query binding ?

  
The binding of an object to a query (More...)

How to query from multiple lists in SharePoint?

  
Using SPSiteDataQuery you can get data from multiple lists. (More...)

Findout Top 2 Highest Salary By Using sql query?

  
Select Top(2) Salary from Table name Where order By Salary Desc (More...)

Write a query to Select top 2 Highest salaries?

  
select Top(2) salary from Tablename order by Salary desc.... (More...)

Query to find Top 10 recors in Sql

  
Select top 10 * from emp order by empid desc (More...)

Why NoLock is used in Sql Select Query?

  
Advantage:
applying nolock in select statement will increase
concurreny and performance in fetching.

Disadvantage:
it does'nt consider the transaction scenario, even if the
transaction is under process not yet commited or rollback
it will fetch the current record
eg

begin tran
insert into tablename
values('1','asdf')

select * from tablename with (nolock)

-- it will display the table with inserted record.
but the transaction is not completed, it can be rollback
so it became dirty read.

(More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend