Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how many type of subquery?

Answer Posted / rajkumar

As database developer, you must have ever written
subqueries in either SQL Server or any other database
platform. This article will describe shortly about types of
subquery.


A subquery is inner query that will be used by outer query.
A subquery could return scalar value or a series of value.
Based on query dependency, a subquery could be self-
contained or correlated one. A self-contained subquery is a
subquery independent from outer query, and correlated
subquery is a subquery that is referencing to a row in
outer query.


Self-contained subquery is easier to debug than correlated
subquery. And it is executed only once whereas correlated
subquery is executed once for each row of outer query.


Sample of self-contained subquery that returns scalar value
is shown below :


Select customerid

From dbo.orders

Where employeeid = (select employeeid from dbo.employees
where lastname = ‘RAJ’);


This query returns customers list whose employee is RAJ.

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration

915


How to insert a new row into a table with "insert into" statements in ms sql server?

915


What is subquery explain with example?

1010


what is bit datatype? : Sql server database administration

866


How is a full-text index updated?

900


Define union, union all, minus, intersect?

935


What are click through reports?

138


What are entities and relationships?

923


What is the maximum rows in sql server table?

868


Will count(column) include columns with null values in its count?

1035


Where can you add custom error messages to sql server?

1055


Is sql server a database?

926


What is a periodical index?

864


How you can move data or databases between servers and databases in sql server?

1005


How can I get data from a database on another server?

935