Searching for "correlated"

Q:

Define "Correlated Subqueries" ?

Answer

In a SQL Database, a 'correlated subquery' is a kind of sub query yet connected subquery is dependent on another query for a value that is returned. In case of execution, the sub query is executed first and afterwards the correlated query will be executed.

Report Error

View answer Workspace Report Error Discuss

Q:

What is correlated query? Explain its uses.

Answer

In a correlated query, the outer query is related to the inner query. This means one or more columns in the outer query are referenced. It’s used when the outer queries value is being used by inner query. For example, we need to find which employee had more perks in the current month than they did in the previous month. The correlated subquery is executed for each row of perks information in the parent query to first determine what the perks were for each employee in the previous month. This data, in turn, is compared to perks for each employee in the current month, and only those employees whose perks in the current month were greater that their previous month's perks are returned.

Report Error

View answer Workspace Report Error Discuss

Subject: Oracle