Skip to content

Commit c9f0262

Browse files
committed
docs(sql): add dedicated folder for WHERE clause with detailed explanation
What - Created `WHERE Clause In SQL` folder to document filtering records in SQL queries. - Explained how `WHERE` is used to apply conditions before grouping or sorting. - Added syntax, examples, and operator usage (comparison, logical, pattern matching). - Clarified how `WHERE` differs from `HAVING`. Why - Filtering data is the foundation of SQL querying. - Developers often confuse `WHERE` with `HAVING` or misuse operators (`=`, `LIKE`, `IN`, `BETWEEN`). - Clear reference improves query accuracy and performance. How - Structured documentation into: - Definition and purpose of `WHERE`. - Basic syntax: `SELECT * FROM employees WHERE dept = 'HR';` - Comparison operators (`=`, `!=`, `<`, `>`, `<=`, `>=`). - Logical operators (`AND`, `OR`, `NOT`). - Special operators (`BETWEEN`, `IN`, `LIKE`, `IS NULL`). - Showed ordering of execution: `FROM → WHERE → GROUP BY → HAVING → ORDER BY`. Key notes - `WHERE` filters rows before grouping or aggregation. - Case sensitivity may vary depending on SQL dialect and collation. - Always use parameterized queries in applications to prevent SQL injection. Real-life applications - Banking: filter accounts with balance > 1,00,000. - HR: find employees hired after 2020. - Retail: fetch products priced between 100 and 500. - Education: list students who scored above 80 in Math. Future improvements - Add combined examples using multiple operators. - Include advanced filtering with subqueries inside `WHERE`. - Compare performance implications of indexed vs non-indexed columns. Signed-off-by: https://github.com/Someshdiwan <[email protected]>
1 parent 8e76f8c commit c9f0262

13 files changed

+1
-2
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ The conditions can include various operators and logical connectors.
44

55
SQL WHERE Clause with Various Conditions.
66

7-
87
list of the conditions you can use in the WHERE clause:
98

109
= : Equal to a specific value.
@@ -33,4 +32,4 @@ NOT : Negates a condition.
3332

3433
IS NULL : Checks for NULL values.
3534

36-
IS NOT NULL : Checks for non-NULL values.
35+
IS NOT NULL : Checks for non-NULL values.

0 commit comments

Comments
 (0)