Professional Documents
Culture Documents
Theory:
Between…AND:
The between operator allows the selection of rows that contain values within a
specified lower and upper limit. The range coded after the word between is inclusive.
You must specify the lower limit first.
Syntax:
Not Between:
Not between works just opposite of between…and. It allows the selection of rows that
does not contain values within a specified lower and upper limit.
Syntax:
Ex:- SQL> select * from computer where cprice not between (30000) and (32000);
Page 1 of 3
IN:
To test for values in a specified set of values, use the IN condition. The IN condition
is also known as the membership condition. The IN condition can be used with any
data type.
Syntax:
Select columnname from <tablename> where columnname in (columnname value,
columnname value);
NOT IN:
The not in condition is the opposite of in condition. This will select all the rows
whose value does not match the values in the list.
Syntax:
Select columnname from < tablename> where columnname no in (columnname value,
columnname value);
Ex:- SQL> select * from computer where cprice not in(35000, 40000);
The null condition includes the IS NULL condition and the IS NOT NULL condition.
The IS NULL condition tests for nulls. A null means the value is unavailable,
unassigned unknown or inapplicable. Therefore we cannot test NULL values with =
because a null cannot be equal or unequal to any value. The IS NULL condition
retrieve all the values in a particular column those are null and is not null retrieves all
the values in a particular column those are not null.
Syntax:
no rows selected
Page 2 of 3
Select * from <tablename> where columnname is not null;
Page 3 of 3