Skip to content

Commit 958b828

Browse files
added sets sql
1 parent d12b36f commit 958b828

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

docs/Cheat-Sheets/SQL.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,48 @@ FROM table1
391391
CROSS JOIN table2;
392392
```
393393

394+
## Set Operations
395+
396+
### UNION
397+
398+
Combines the results of two `SELECT` statements and removes duplicate rows.
399+
400+
```sql
401+
SELECT column1, column2 FROM table1
402+
UNION
403+
SELECT column1, column2 FROM table2;
404+
```
405+
406+
### UNION ALL
407+
408+
Combines the results of two `SELECT` statements, including duplicate rows.
409+
410+
```sql
411+
SELECT column1, column2 FROM table1
412+
UNION ALL
413+
SELECT column1, column2 FROM table2;
414+
```
415+
416+
### INTERSECT
417+
418+
Returns the rows that are common to both `SELECT` statements.
419+
420+
```sql
421+
SELECT column1, column2 FROM table1
422+
INTERSECT
423+
SELECT column1, column2 FROM table2;
424+
```
425+
426+
### EXCEPT
427+
428+
Returns the rows that are in the first `SELECT` statement but not in the second.
429+
430+
```sql
431+
SELECT column1, column2 FROM table1
432+
EXCEPT
433+
SELECT column1, column2 FROM table2;
434+
```
435+
394436
## Subqueries
395437

396438
```sql

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ theme:
107107
#plugins
108108
plugins:
109109
# - optimize
110+
- glightbox
110111
- enumerate-headings:
111112
toc_depth: 6
112113
strict: true

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mkdocs-minify-plugin
44
mkdocs-simple-plugin
55
mkdocs-git-revision-date-localized-plugin
66
mkdocs-enumerate-headings-plugin
7+
mkdocs-glightbox
78
mkdocs-with-pdf
89
mkdocs-jupyter
910
qrcode

0 commit comments

Comments
 (0)