What is Sub query or Nested query or Inner query in SQL?

A Subquery/ Inner query/ Nested query is a query within another SQL outer query and embedded within the WHERE clause.

A subquery (also known as a nested query or inner query) in SQL is a query nested inside another query. It is used to retrieve data based on the results of another query. Subqueries are enclosed within parentheses and can be used in SELECT, INSERT, UPDATE, or DELETE statements. They help to break complex problems into smaller, more manageable parts and provide a powerful way to filter, aggregate, or perform calculations on data in a database.


Post a Comment

Previous Post Next Post