PCS 203-SM02
PCS 203-SM02
2
Write SQL queries using logical operators [ =, <,>, etc]
1) AND Operator
The AND operator is used to combines two or more conditions but if it is true when all the conditions
are satisfied.
2) IN Operator
It is used to remove the multiple OR conditions in SELECT, INSERT, UPDATE, or DELETE. and We can also
use NOT IN to minimize the rows in your list and any kind of duplicate entry will be retained.
3) NOT Operator
The NOT operator is used in combination with other operators to give the opposite result, also called
the negative result.
4) OR Operator
The OR operator is used to combines two or more conditions but if it is true when one of the conditions
are satisfied.
5) LIKE Operator
In SQL, the LIKE operator is used in the WHERE clause to search for a specified pattern in a column.
6) BETWEEN Operator
The SQL BETWEEN condition allows you to easily test if an expression is within a range of values
(inclusive).
7) ALL Operator
The ALL operator returns TRUE if all of the subqueries values matches the condition. All operator is used
with SELECT, WHERE, HAVING statement.
8) ANY Operator
It returns a boolean value as a result. It returns TRUE if ANY of the subquery values match the condition.
9) EXISTS Operator
In SQL,Exists operator is used to check whether the result of a correlated nested query is empty or not.
The EXISTS operator is used to test for the existence of any record in a subquery. The EXISTS operator
returns TRUE if the subquery returns one or more records.