WHERE
clause returns a specific value from a table or multiple tables based on specified conditions. It will filter out records you do not want to be included and only returns the exact result when the condition is fulfilled.
SELECT column1, column2, ...
defines the columns where the records will be displayed.FROM table_name
sets the table name where the records will be taken from.WHERE [condition]
specifies the search condition using comparison or logical operators (e.g., >
, =
, LIKE
)FROM
clause -> then it executes the WHERE
condition -> after that, it will SELECT
the specified columns.=
OperatorWHERE
clause’s condition is case-sensitive, so ensure that you specify the correct and precise value.!=
Operator<>
operator for another “not equal” operator.WHERE
clause’s condition is case-sensitive. If you set texas
it will return all records from the salary table.>
Operator<
operator for a “less than” condition.<=
Operator>=
operator for a “greater than or equal to” condition.LIKE
Operator%string
.IS NULL
Operatortrue
and display the result set if a value is NULL
; otherwise, it will return false
with no result set.