Different operators used in building sub queries

What are the different operators used in building sub queries?

Following operators can be used in building sub queries:

IN: Allows multiple values to be checked.

EXIST: Checks if a value exists.

There are other logical operators like AND, OR and comparison operators like =, <, > can also be used.

Example:
Select emp_id, emp_name from employee
Where emp_id IN (select emp_id FROM salary);

What are the different operators used in building sub queries?

IN and NOT IN operator
ANY
ALL
Exists
What are the guidelines for using SUB-QUERIES?
Following things need to be kept in mind when you write sub-queries: Caution should be taken with simple sub-query, especially when a normal value operator is used on the results of a sub-query, only one field must be returned....
What is correlated sub-query?
In a simple SubQuery, the result retrieved by the inner query is fed to the outer query. The outer query takes the result as its input and processes it to produce its output....
Explain drop and truncate table command
TRUNCATE removes all rows from a table. The operation cannot be rolled back and no triggers will be fired.....
Post your comment