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.
- 📚 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.
- Introduction to SQL & Relational Databases
- SELECT, INSERT, UPDATE, DELETE Statements
- Data Types & Constraints (PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK)
- Joins (INNER, LEFT, RIGHT, FULL, CROSS)
- Aggregation & Grouping (
GROUP BY
,HAVING
, COUNT, SUM, AVG) - Subqueries & Common Table Expressions (CTEs)
- Window Functions (
ROW_NUMBER()
,RANK()
,DENSE_RANK()
,LEAD()
,LAG()
) - Recursive Queries (
WITH RECURSIVE
for hierarchical data) - Pivot & Unpivot Data (Dynamic Pivoting Techniques)
- Indexes (
B-Trees
,Hash Indexes
,Covering Indexes
) - Query Execution Plans & Optimization
- Partitioning & Sharding Large Datasets
- ACID Properties (Atomicity, Consistency, Isolation, Durability)
- Isolation Levels (
READ COMMITTED
,SERIALIZABLE
,REPEATABLE READ
) - Deadlocks & Locking Mechanisms
- Stored Procedures & Functions
- Triggers & Event-Driven SQL
- NoSQL vs. SQL (When to use SQL vs. NoSQL)
- Data Warehousing Concepts & SQL for Big Data
- PostgreSQL
- MySQL
- SQLite
- Microsoft SQL Server
- Oracle SQL
- Building a Movie Database
- E-commerce Order Management System
- Analyzing Customer Transactions
- Real-time Data Aggregation with Window Functions
-
Clone the repository
git clone https://github.com/saadsalmanakram/Art-of-SQL.git cd Art-of-SQL
-
Set up a local database
- Install PostgreSQL, MySQL, or SQLite.
- Load example datasets provided in the
datasets/
folder.
-
Run Example Queries
SELECT * FROM customers;
-
Practice SQL Challenges
- Open
exercises.sql
and start solving problems.
- Open
We welcome contributions! If you have improvements or new SQL tricks to add, feel free to submit a pull request.
If you find this repository helpful, give it a ⭐ and share it with your network!