SUBQUERIES - Basics
SUBQUERIES - Basics
com
XR0S5B9UT4
Subqueries
Proprietary
This filecontent. © Great
is meant Learning.
for personalAll Rights
use Reserved. Unauthorized use or distribution prohibited.
by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
Sub-Queries
[email protected]
XR0S5B9UT4
Proprietary
This filecontent. © Great
is meant Learning.
for personalAll Rights
use Reserved. Unauthorized use or distribution prohibited.
by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
Sub-Queries
Proprietary
This filecontent. © Great
is meant Learning.
for personalAll Rights
use Reserved. Unauthorized use or distribution prohibited.
by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
Sub-Queries
Proprietary
This filecontent. © Great
is meant Learning.
for personalAll Rights
use Reserved. Unauthorized use or distribution prohibited.
by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
Correlated Sub-Queries
[email protected]
XR0S5B9UT4
Proprietary
This filecontent. © Great
is meant Learning.
for personalAll Rights
use Reserved. Unauthorized use or distribution prohibited.
by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
Sample Interview Questions
• Find the Salary greater than Average salary using Joins or Sub-Queries
• Select salary from table1 where salary > (select avg(salary) from table1)
[email protected]
XR0S5B9UT4
Proprietary
This filecontent. © Great
is meant Learning.
for personalAll Rights
use Reserved. Unauthorized use or distribution prohibited.
by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
Sample Interview Questions
• Find the Salary greater than Average salary using Joins or Sub-Queries
• Select salary from table where salary > (select avg(salary) from table1)
• Display employees who are reporting to ADAM
• Select * from employees where manager_id = (select manager_id from
[email protected]
XR0S5B9UT4
employees where name = ADAM)
Proprietary
This filecontent. © Great
is meant Learning.
for personalAll Rights
use Reserved. Unauthorized use or distribution prohibited.
by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.
Sample Interview Questions
• Find the Salary greater than Average salary using Joins or Sub-Queries
• Select salary from table where salary > (select avg(salary) from table1)
• Display employees who are reporting to ADAM
• Select * from employees where manager_id = (select manager_id from
[email protected]
XR0S5B9UT4
employees where name = ADAM)
• Write an SQL query to fetch the Ids that are present in table1 but not
in table2
• SELECT Id FROM table1
WHERE Id Not IN
(SELECT Id FROM table2);
Proprietary
This filecontent. © Great
is meant Learning.
for personalAll Rights
use Reserved. Unauthorized use or distribution prohibited.
by [email protected] only.
Sharing or publishing the contents in part or full is liable for legal action.