https://github.com/saadsalmanakram/art-of-sql
A comprehensive SQL guide covering everything from basic queries to advanced database management. Learn SQL syntax, commands, and data types, master SELECT statements, joins, subqueries, and data manipulation (INSERT, UPDATE, DELETE), and explore database design principles like normalization and indexing.
https://github.com/saadsalmanakram/art-of-sql
sql structured-query-language
Last synced: about 1 month ago
JSON representation
A comprehensive SQL guide covering everything from basic queries to advanced database management. Learn SQL syntax, commands, and data types, master SELECT statements, joins, subqueries, and data manipulation (INSERT, UPDATE, DELETE), and explore database design principles like normalization and indexing.
- Host: GitHub
- URL: https://github.com/saadsalmanakram/art-of-sql
- Owner: saadsalmanakram
- Created: 2024-08-06T17:33:07.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-01-28T20:13:32.000Z (4 months ago)
- Last Synced: 2025-01-28T21:24:28.330Z (4 months ago)
- Topics: sql, structured-query-language
- Language: TSQL
- Homepage:
- Size: 212 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
# 🏆 Art of SQL: Mastering SQL from Beginner to Advanced

Welcome to **Art-of-SQL**, your ultimate guide to mastering **Structured Query Language (SQL)**! Whether you're a beginner or an advanced user, this repository will take you through **database design, querying, optimization, and advanced SQL concepts** with practical examples.
## 🚀 What You'll Learn
- **📚 SQL Fundamentals:** Queries, Joins, Aggregations, Subqueries.
- **🛠️ Database Design:** Normalization, Indexing, Constraints.
- **⚡ Performance Optimization:** Query tuning, Indexing, Caching.
- **📊 Analytical SQL:** Window Functions, CTEs, Pivoting Data.
- **🔄 Transactions & Concurrency:** ACID properties, Locking, Isolation Levels.
- **📡 Advanced SQL:** Recursive Queries, Stored Procedures, Triggers.## 📌 Topics Covered
### 1️⃣ SQL Basics
- **Introduction to SQL & Relational Databases**
- **SELECT, INSERT, UPDATE, DELETE Statements**
- **Data Types & Constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK)**### 2️⃣ Intermediate SQL
- **Joins (INNER, LEFT, RIGHT, FULL, CROSS)**
- **Aggregation & Grouping (`GROUP BY`, `HAVING`, COUNT, SUM, AVG)**
- **Subqueries & Common Table Expressions (CTEs)**### 3️⃣ Advanced SQL
- **Window Functions (`ROW_NUMBER()`, `RANK()`, `DENSE_RANK()`, `LEAD()`, `LAG()`)**
- **Recursive Queries (`WITH RECURSIVE` for hierarchical data)**
- **Pivot & Unpivot Data (Dynamic Pivoting Techniques)**### 4️⃣ Performance Optimization
- **Indexes (`B-Trees`, `Hash Indexes`, `Covering Indexes`)**
- **Query Execution Plans & Optimization**
- **Partitioning & Sharding Large Datasets**### 5️⃣ Transactions & Concurrency
- **ACID Properties (Atomicity, Consistency, Isolation, Durability)**
- **Isolation Levels (`READ COMMITTED`, `SERIALIZABLE`, `REPEATABLE READ`)**
- **Deadlocks & Locking Mechanisms**### 6️⃣ Advanced SQL & Real-World Applications
- **Stored Procedures & Functions**
- **Triggers & Event-Driven SQL**
- **NoSQL vs. SQL (When to use SQL vs. NoSQL)**
- **Data Warehousing Concepts & SQL for Big Data**## 🛠️ Supported SQL Databases
- **PostgreSQL**
- **MySQL**
- **SQLite**
- **Microsoft SQL Server**
- **Oracle SQL**## 🔥 Hands-on Projects & Challenges
- **Building a Movie Database**
- **E-commerce Order Management System**
- **Analyzing Customer Transactions**
- **Real-time Data Aggregation with Window Functions**## 📌 Getting Started
1. **Clone the repository**
```bash
git clone https://github.com/saadsalmanakram/Art-of-SQL.git
cd Art-of-SQL
```
2. **Set up a local database**
- Install **PostgreSQL**, **MySQL**, or **SQLite**.
- Load example datasets provided in the `datasets/` folder.3. **Run Example Queries**
```sql
SELECT * FROM customers;
```4. **Practice SQL Challenges**
- Open `exercises.sql` and start solving problems.## 📚 Resources & References
- [PostgreSQL Documentation](https://www.postgresql.org/docs/)
- [MySQL Official Guide](https://dev.mysql.com/doc/)
- [SQL Optimization Guide](https://use-the-index-luke.com/)## 🤝 Contributing
We welcome contributions! If you have improvements or new SQL tricks to add, feel free to submit a pull request.## ⭐ Support the Project
If you find this repository helpful, give it a ⭐ and share it with your network!---