WHERE Clause With Logical Operators
Query:
SELECT * FROM employees WHERE salary > 50000 AND department_id = 1;
This query will give all the employees who have salary greater than 5000 and belongs to it department,
Output:
Query:
SELECT * FROM employees WHERE salary < 50000 OR department_id = 2;
This query will give all the employees who have salary less than 5000 or who belongs to sales department.
Output:
Query:
SELECT * FROM employees WHERE NOT department_id = 1;
This query will give all the employees who does not belongs to it department.
Output:
WHERE Clause in MariaDB
MariaDB uses SQL (Structured Query Language) and it is an open-source relational database management system (RDBMS) for managing and manipulating data. The WHERE clause in SQL queries is used to filter and obtain specific data. The ability to remove and retrieve specific data using the WHERE clause in SQL queries is one of the main features that makes MariaDB robust. This article will examine the syntax and many uses for the WHERE clause in MariaDB.
Contact Us