What are subqueries in SQL? - ProProfs Discuss
Advertisement

What are subqueries in SQL?

What are subqueries in SQL?<br/>

Change Image    Delete

Asked by Maarsh, Last updated: Nov 19, 2024

+ Answer
Request
Question menu
Vote up Vote down

3 Answers

Heena

Heena

Heena
Heena

Answered Oct 18, 2017

Correct answer is below:

A main query can have more than one subquery.
B. The subquery and main query can retrieve data from different tables.
C. Multiple columns or expression can be compared between the subquery and main query.

upvote downvote
Reply 

profa42

profa

profa42
Profa

Answered Oct 06, 2017

Answers that are supposed to be correct are ridiculous. Scalar subqueries do not have to fetch data from the same table as main query. It is NOT true that only one column can be compared between the subquery and main query - you can use subquery with EXISTS condition, and you can compare whatever you want with correlated subquery.

upvote downvote
Reply 

John Smith

John Smith

John Smith
John Smith

Answered Nov 11, 2016

A main query can have more than one subquery.
2. The subquery and main query must retrieve data from the same table.
3. Only one column or expression can be compared between the subquery and main query.
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.