How to filter data using SELECT and WHERE clause in MySQL?
Demonstrates querying rows with comparison operators, AND, OR, LIKE, and IN conditions.
-- Select all employees with salary greater than 50000 SELECT employee_id, first_name, last_name, salary FROM employees WHERE salary > 50000; -- Filter using LIKE pattern matching & IN list SELECT * FROM employees WHERE last_name LIKE 'S%' OR employee_id IN (1, 3);
+-------------+------------+-----------+----------+ | employee_id | first_name | last_name | salary | +-------------+------------+-----------+----------+ | 1 | John | Doe | 55000.00 | | 2 | Alice | Smith | 62000.00 | | 4 | Carol | Williams | 75000.00 | +-------------+------------+-----------+----------+ 3 rows in set (0.00 sec)