MariaDB WHERE Clause
In MariaDB, WHERE clause is used with SELECT, INSERT, UPDATE and DELETE statement to select or change a specific location where we want to change.
It is appeared after the table name in a statement.
Syntax:
Note: WHERE clause is an optional clause. It can be used with AND, OR, AND & OR, LIKE operators.
WHERE Clause with Single Condition
Example:
We have a table “Students”, having some data. Let’s retrieve all records from “Student” table where student_id is less than 6.
Output:
WHERE Clause with AND Condition
It would return all columns from “Student” table where “student_name” is Ajeet AND “student_id” is greater than or equal to 1.
Both conditions must be satisfied.
Output:
WHERE Clause with OR Condition
It would return all columns from “Student” table where “student_name” is Ajeet OR “student_id” is greater than or equal to 1.
Anyone of the condition must be satisfied.
Output:
WHERE Clause with AND & OR Condition
It would return all columns from “Student” table where “student_name” is Ajeet AND “student_id” is greater than or equal to 1 OR student_address is Delhi.
Output: