You are on page 1of 1

The SQL IN Operator

It is sometimes necessary to specify multiple values in WHERE clause. The IN operator is used in order
to specify multiple values in WHERE clause. It is a shorthand for multiple OR conditions.
IN Syntax:

SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1,  value2, ...);
Another form of this syntax is

SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT  STATEMENT);

The SQL BETWEEN Operator


Sometimes it is necessary to select values(Text, number, or dates) between a given range. Therefore the
BETWEEN operator is used to select values within a given range. Since there are begin and end values
included in between operator, therefore this operator is incisive.
BETWEEN Syntax:

SELECT column_name(s)
FROM table_name
WHERE column_name  BETWEEN value1 AND value2;

SQL JOIN
In order to combine rows from two or more tables, SQL JOIN clause is used. There are different types of
JOINs.
(INNER) JOIN:In order to show records that matches from both table, (INNER) JOIN is used.
INNER JOIN Syntax:

SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name  =  table2.column_name;
LEFT (OUTTER) JOIN: This function returns records from the left table and matches records from the
right table.

You might also like