Suggest an editImprove this articleRefine the answer for “What does the WHERE operator do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)The `WHERE` operator in SQL is used to filter rows - selecting only the records that satisfy a given condition: a simple comparison, a range, a set-membership check (`IN`), or a pattern (`LIKE`). **Key point:** `WHERE` is applied before grouping (`GROUP BY`) and sorting (`ORDER BY`); conditions can be combined with `AND`, `OR`, `NOT`.Shown above the full answer for quick recall.Answer (EN)ImageThe `WHERE` **operator** in SQL is used to **filter rows**, that is, to select only the records satisfying a given condition. **Syntax:** ```sql SELECT Column1, Column2, ... FROM Table_Name WHERE Condition; ``` ### Usage examples 1. **A simple comparison:** ```sql SELECT * FROM Employees WHERE Age = 30; ``` - Selects only employees whose age is 30. 2. **A range comparison:** ```sql SELECT * FROM Employees WHERE Age > 25 AND Age < 40; ``` - Selects employees between 26 and 39 years old. 3. **A set-membership check:** ```sql SELECT * FROM Employees WHERE DepartmentID IN (101, 102); ``` - Selects employees from departments 101 or 102. 4. **Using patterns:** ```sql SELECT * FROM Employees WHERE Name LIKE 'A%'; ``` - Selects employees whose names start with the letter "A". **Notes:** - `WHERE` is applied **before grouping (**`GROUP BY`**) and sorting (**`ORDER BY`**)**. - Conditions can be combined with `AND`, `OR`, `NOT`. > Put simply, `WHERE` is SQL's tool for **filtering out unneeded rows and selecting only the data you need**.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.