Commit bc9cf06
committed
docs(sql): add overview of distinct SQL clauses in dedicated folder
What
- Introduced documentation under `Distinct Clauses in SQL` folder.
- Provided structured explanations of commonly used SQL clauses:
- `SELECT` – retrieve specific columns.
- `FROM` – identify source table(s).
- `WHERE` – filter records based on conditions.
- `GROUP BY` – aggregate rows with common values.
- `HAVING` – apply conditions to aggregated groups.
- `ORDER BY` – sort results ascending/descending.
- `LIMIT` – restrict number of rows returned.
- `JOIN` & `ON` – combine rows across tables with conditions.
- `UNION` – merge results of multiple queries.
- `INSERT INTO` – add records.
- `UPDATE` – modify existing records.
- `DELETE` – remove rows from a table.
Why
- Centralizes explanations of SQL clauses into one reference folder.
- Distinguishes between clauses that are often confused (`WHERE` vs `HAVING`, `JOIN` vs `UNION`).
- Serves as a quick reference for learners and developers working on queries.
How
- Organized clauses into clear bullet points with concise one-line purposes.
- Followed standard SQL capitalization for readability.
- Highlighted relational aspects (e.g., `JOIN` requires `ON` for conditions).
- Positioned the folder for easy extension with examples and advanced topics.
Key notes
- SQL execution order differs from written order: `FROM` → `WHERE` → `GROUP BY` → `HAVING` → `SELECT` → `ORDER BY` → `LIMIT`.
- `UNION` removes duplicates by default, `UNION ALL` preserves them.
- `INSERT`, `UPDATE`, `DELETE` are Data Manipulation Language (DML) operations.
- `SELECT DISTINCT` can be combined with other clauses to filter unique rows.
Real-life applications
- Reporting dashboards: aggregate with `GROUP BY` and filter with `HAVING`.
- E-commerce apps: filter users with `WHERE`, combine tables with `JOIN`, sort with `ORDER BY`.
- Banking/Finance: merge transactions using `UNION` across multiple tables.
- CRUD operations: `INSERT`, `UPDATE`, `DELETE` for day-to-day application data management.
Future improvements
- Expand each clause with query syntax and runnable examples.
- Add diagrams explaining query execution order.
- Cover advanced clauses like `WITH` (CTE), `OVER` (window functions), and subqueries.
Signed-off-by: https://github.com/Someshdiwan <[email protected]>1 parent 9865721 commit bc9cf06
File tree
5 files changed
+0
-0
lines changed- Section28JDBCusingSQLite/Clauses in SQL/Distinct Clauses In SQL
5 files changed
+0
-0
lines changed
0 commit comments