What is the Sub-Query?And what is the properties of Sub-Query?

What is the Sub-Query?And what is the properties of Sub-Query?

Sub-queries are bassically defined assub-selects, Its allow a SELECT statement to beexecuted arbitrarily within the body of anotherSQL statement. A sub-query is mainly executed byenclosing in a set of parenthesis. Sub-queriesare generally used to return a single row as anatomic value, They may be used to comparision,Its may be use for compare the values againstmultiple rows with the IN-keyword. A Subquery isa SELECT statement that is nested within anotherT-SQL statement. A Subquery SELECT statement ifexecuted independently of the T-SQL statement, Inwhich it is nested, will return a resultset.Meaning a subquery SELECT statement can standalone and is not depended on the statement inwhich it is nested. A subquery SELECT statementcan return any number of values, and can be foundin, The column list of a SELECT statement,FROM,GROUP BY,HAVING,and/or ORDER BY clauses of aT-SQL statement. A Subquery can also be used as aparameter to a function call. Basically asubquery can be used anywhere an expression canbe used.

By:UMANG
Date:2010-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related SQL Subjective Links

SQL Subjective interview questions and answers for experienced and fresher