Skip to content

Commit 9c8ba6d

Browse files
committed
Added Subqueries page
1 parent aae303d commit 9c8ba6d

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed
File renamed without changes.

docs/sql/SQL- Advance/subqueries.md renamed to docs/sql/SQL-Advance/subqueries.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ HAVING AVG(salary) > (SELECT AVG(salary) FROM employees);
400400
**When to Choose What:**
401401

402402
**Use Subqueries When:**
403+
403404
- Logic is clearer with step-by-step thinking
404405
- You need aggregated values for comparison
405406
- Checking for existence/non-existence (EXISTS/NOT EXISTS)
@@ -534,6 +535,7 @@ WHERE o.order_date >= '2024-01-01';
534535
## Conclusion
535536

536537
Subqueries are your tool for asking layered questions - calculate something first, then use that answer to get what you really want. They make complex logic readable by breaking problems into steps. Start with simple subqueries in `WHERE` clauses, then gradually work up to more complex patterns.
538+
537539
**Remember :** if your subquery gets too complicated, there's probably a simpler way to write it. Keep it clear, keep it tested, and your queries will be both powerful and maintainable.
538540

539541
<GiscusComments/>

sidebars.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
1+
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
22

33
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
44

@@ -144,6 +144,14 @@ const sidebars: SidebarsConfig = {
144144
'sql/SQL-joins/self-join',
145145
],
146146
},
147+
{
148+
type: 'category',
149+
label: 'SQL Advance',
150+
className: 'custom-sidebar-sql-advance',
151+
items: [
152+
'sql/SQL-Advance/sql-subqueries',
153+
],
154+
},
147155
],
148156
},
149157
{

0 commit comments

Comments
 (0)