What is the difference between Nested Subquery and Correlated Subquery?

Category: SQLWhat is the difference between Nested Subquery and Correlated Subquery?
Editor">Editor Staff asked 2 years ago

What is the difference between Nested Subquery and Correlated Subquery?

1 Answers
Editor">Editor Staff answered 2 years ago

Subquery within another subquery is called Nested Subquery.  If the output of a subquery depends on column values of the parent query table then the query is called Correlated Subquery.

SELECT adminid(SELEC Firstname+' '+Lastname  FROM Employee WHERE
 empid=emp. adminid)AS EmpAdminId FROM Employee;

The result of the query is the details of an employee from the Employee table.