IN - LIKE - Corr - Queries: SQL - 230 Page 1
IN - LIKE - Corr - Queries: SQL - 230 Page 1
IN
The IN operator compares a value to a list of specified values.
The IN operator returns true if the compared value matches at least one value in the list; otherwise, it returns
false.
LIKE
The LIKE operator compares a value to similar values using a wildcard operator.
SQL provides two wildcards used in conjunction with the LIKE operator:
The percent sign ( %) represents zero, one, or multiple characters.
The underscore sign (_) represents a single character.
1. Finds all employees whose first name starts with the string Jo
2. Find all the employees whose job start with A
3. finds all employees with the first names whose the second character is 0:
SQL_230 Page 1
4. finds all employees with the empno ends with 8:
Some more operators will be discussed after subquery topic and aliasing topic
Generally the outer query runs with the result of the innerquery
SQL_230 Page 2
Multirow subqueries return either:
o One column with multiple rows (i.e. a list of values), or
o Multiple columns with multiple rows (i.e. tables).
Correlated subqueries, where the inner query relies on information obtained from the outer query.
SQL_230 Page 3