Database Reference
In-Depth Information
Operator
=
!=
<
<=
>
>=
<>
BETWEEN
IS NULL
Description
Equal
Not Equal
Less Than
Less than or Equal to
Greater than
Greater than or Equal to
Not Equal
Between two specified values Is a NULL value
Example: demonstrates the use of the BETWEEN operator. Sol:
SELECT Product_ID, Product_Name
FROM product_info
WHERE Cost_price BETWEEN 500 AND 2000;
Using the AND/OR Operator with WHERE Clause
Every predicate evaluates to true, false, or unknown. If more than one predicate is included
in the WHERE clause, they are joined together by the OR keyword or the AND keyword.
The OR operator instructs the database management system software to retrieve rows that
match either condition. If AND is used, then predicates on either side must evaluate to true
for the row to pass the filter.
Example: Retrieve data about lecturer of CSE department from staff table.
Sol:
SELECT * FROM staff
Search WWH ::




Custom Search