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

What are built in functions?

1067


Can we call future method from queueable?

1097


How do I change my passwords (database, LDAP, and so on) without causing an outage?

1114


How use inner join in sql server?

1186


Can we call stored procedure in trigger?

996


How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?

2058


What is the purpose of indexing?

1090


Explain filtered indexes benefits?

1042


Define candidate key, alternate key, and composite key.

967


When would you use sql joins?

1026


How to convert character strings into numeric values?

1144


What are logical database components? : SQL Server Architecture

1092


How do clustered indexes store data?

1151


How raid can influence database performance?

1084


List down some advantages of sql stored procedure?

1014