SQL WHERE Clause
WHERE CLAUSE:-


- The WHERE clause is used to extract only those records that fulfill a specified condition.
- The WHERE clause is a data manipulation language statement. Basically, it is used to filter records based on the condition.
- The WHERE clause is not only used with the SELECT statement but it is also used with UPDATE, DELETE statement.
- The WHERE clause is also used to extract the data from a single table or by joining with multiple tables.
SYNTAX:-
SELECT column1, column2, ...
FROM table_name
WHERE condition;
EXAMPLE:-
Consider the "STUDENTS" table having the following records −
The following SQL statement selects all the Students FirsteName, Address whose marks are less than 370.
SELECT FirsteName, Address
FROM STUDENTS
WHERE Marks < 370 ;
OUTPUT:-
Operators Used in the WHERE Clause:-
| 1. = | Equal |
| 2. > | Greater than |
| 3. < | Less than |
| 4. >= | Greater than or equal |
| 5. <= | Less than or equal |
| 6. != | Not equal |
| 7. BETWEEN | Between a certain range |
| 8. LIKE | Search for a Pattern |
| 9. IN | To specify multiple possible values for a column |
Comments
Post a Comment