Skip to content

Commit 6412318

Browse files
done SQL cheat sheet
1 parent 57edcce commit 6412318

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

docs/Cheat-Sheets/SQL.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,31 @@ description: A comprehensive reference guide for SQL, covering data types, DDL,
1010

1111
This cheat sheet provides an exhaustive overview of SQL (Structured Query Language), covering data types, Data Definition Language (DDL), Data Manipulation Language (DML), Data Query Language (DQL), Transaction Control Language (TCL), joins, subqueries, window functions, common table expressions (CTEs), and best practices. It aims to be a complete reference for writing and understanding SQL queries. This cheat sheet is designed to be generally applicable across different SQL database systems (e.g., MySQL, PostgreSQL, SQL Server, Oracle, SQLite), but notes specific differences where significant.
1212

13+
??? tip "SQL Cheat Sheet Images"
14+
<figure markdown="span">
15+
![Image not found, use the link below](https://www.sqltutorial.org/wp-content/uploads/2016/04/SQL-Cheet-Sheet-1.png){ width="100%" }
16+
![Image not found, use the link below](https://www.sqltutorial.org/wp-content/uploads/2016/04/SQL-Cheat-Sheet-2.png){ width="100%" }
17+
![Image not found, use the link below](https://www.sqltutorial.org/wp-content/uploads/2016/04/SQL-Cheat-Sheet-3.png){ width="100%" }
18+
<figcaption>https://www.sqltutorial.org/sql-cheat-sheet/</figcaption>
19+
</figure>
20+
---
21+
<figure markdown="span">
22+
![Image not found, use the link below](https://learnsql.com/blog/mysql-cheat-sheet/mysql-cheat-sheet-a4-page-1.webp){ width="100%" }
23+
![Image not found, use the link below](https://learnsql.com/blog/mysql-cheat-sheet/mysql-cheat-sheet-a4-page-2.webp){ width="100%" }
24+
<figcaption>https://learnsql.com/blog/mysql-cheat-sheet/</figcaption>
25+
</figure>
26+
---
27+
<figure markdown="span">
28+
![Image not found, use the link below](https://media.datacamp.com/legacy/image/upload/v1714038485/SQL_for_Data_Science_826c347c43.png){ width="100%" }
29+
<figcaption>https://www.datacamp.com/cheat-sheet/sql-basics-cheat-sheet</figcaption>
30+
</figure>
31+
---
32+
<figure markdown="span">
33+
![Image not found, use the link below](https://media.datacamp.com/legacy/image/upload/v1698139537/My_SQL_Cheat_Sheet_f2d0d7da20.png){ width="100%" }
34+
<figcaption>https://www.datacamp.com/cheat-sheet/my-sql-basics-cheat-sheet</figcaption>
35+
</figure>
36+
37+
1338
## Data Types
1439

1540
### Numeric
@@ -289,8 +314,24 @@ GROUP BY department_id
289314
HAVING AVG(salary) > 50000;
290315
```
291316

317+
## Order of execution
318+
??? tip "Order of execution"
319+
<figure markdown="span">
320+
![Image not found, use the link below](../assets/img/SQL_order_of_execution.gif){ width="100%" }
321+
</figure>
322+
292323
## Joins
293324

325+
Visualise joins:
326+
327+
- https://joins.spathon.com/
328+
- https://sql-joins.leopard.in.ua/
329+
330+
<figure markdown="span">
331+
![Image not found, use the link below](../assets/img/sqlJoinsSummary.png){ width="100%" }
332+
<figcaption>https://www.atlassian.com/data/sql/sql-join-types-explained-visually</figcaption>
333+
</figure>
334+
294335
### INNER JOIN
295336

296337
```sql
612 KB
Loading
34.6 KB
Loading

0 commit comments

Comments
 (0)