how many type of subquery?

Answers were Sorted based on User's Feedback



how many type of subquery?..

Answer / 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

how many type of subquery?..

Answer / somu

2

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More SQL Server Interview Questions

Tell me in brief how sql server enhances scalability of the database system?

1 Answers  


What is GUID in sql server?

1 Answers   BirlaSoft,


I have a table in which phno is one of the columns.i do have some values in tht phno column.i need to update phno column values with 0(zero) as prefix.give me a correct solution plz...

7 Answers   Value Labs,


What is sqlservr.exe - process - sql server (sqlex?press)?

1 Answers  


what is the disadvantage of SQL Loder?

1 Answers   TCS,


How can you set the threshold at which sql server will generate keysets asynchronously?

1 Answers  


What is excution Plan in sql server

1 Answers   CarrizalSoft Technologies, TCS,


What happens if the update subquery returns no rows in ms sql server?

1 Answers  


How to loop through the result set with @@fetch_status?

1 Answers  


What are magic tables in sql server?

1 Answers  


What is resource db in sql server?

1 Answers  


What are “unrepeatable reads”?

1 Answers  


Categories