Interviews8 answers
What is sub query and its properties?
8 Answers
it is a query under query with in " where" condition
Ankur SharmaPosted Jan 22, 2018, 2:15 AM EST
Sub Query - A Query which is inside where clause. It returns data which is used in the main query to execute.Sub query is always executes first. More than one sub query in a single query. It does not contain order by clause
SuryaPosted Jan 18, 2018, 12:33 AM EST
Query with in query that is called Sub query.sub query also called INNER QUERY.For example see the below query:
SELECT p.productid, p.productName
FROM products p
WHERE p.productid IN
(SELECT pd.productid
FROM productdetails pd
WHERE pd.quantity > 5);
it is the inner query in this statement.
(SELECT pd.productid FROM productdetails pd WHERE pd.quantity > 5)
Rupesh KumarPosted Jan 14, 2018, 12:18 AM EST
A subquery is also known as a nested query which means query inside another query.
A subquery is used to return data that will be used in the main query
as a condition to further restrict the data to be retrieved.
Properties of Sub-Query A subquery should be boxed within the parenthesis. A subquery should be placed within the right hand of the comparison operator, and a subquery cannot contain an ORDER BY clause. A query can contain more than one sub-queries.
Saravanakumar SekaranPosted Jan 2, 2018, 9:24 PM EST
Subquery is a nested query, not necessarily defined by a where clause only. Subquery act as a filter condition for the primary query
Anil Kumar MurmuPosted Dec 24, 2017, 8:29 AM EST
A Subquery or Inner query or a Nested query is a query within another SQL query and embedded within the WHERE clause. A subquery is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved.
Mukesh SagarPosted Nov 17, 2017, 8:56 AM EST
In simple words , Sub query is a collection of queries like nested queries ( A query with another query embedded with another queries with in the "Where" class.The use of Sub query is used to return the data that is used in the main query then the condition to restrict the data.
Properties:
The query must contain the two or more sub queries.It must be enclosed with the parenthesis.
Nithya MathanPosted Nov 15, 2017, 5:44 AM EST
''
Suresh KumarPosted Nov 9, 2017, 7:26 AM EST





