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

How to convert a numeric expression from one data type to another?

0 Answers  


What is store procedure?

0 Answers  


whats new about truncate in sql server 2008?

0 Answers   MedSave Healthcare, Serco,


how to get the automatic backup of the database in the sql server

4 Answers  


What is the maximum size of column in sql server?

0 Answers  






How to find the last update record in SQL Server?

4 Answers  


What value could be assigned to Varchar Type?

3 Answers  


What is query optimizer in sql server?

0 Answers  


Hi, I Created 3 Tables Person(PersID[prkey],Name,Email,Password), Project(ProjName,ProjID[prkey],ProjLeader,ProjManager) & ProjectInvolvement(EntryDate,ProjID[frkey],PersID[frkey],ProjDuration). For this how can i INSERT,UPDATE & DELETE Through PROCEDURE? Please Post the Answer for me. Desai.

0 Answers  


Can the “if update (colname)” statement be used in a delete trigger?

0 Answers  


Show Practically Sql Server Views are updatable?

0 Answers   QuestPond,


Suppose i have a table that contains 5 columns like col1,col2...colm5.I want to import only two column through BCP utility.How to do same through BCP in sybase.

0 Answers   HCL,


Categories