- Abhimanyu Saklani
A structured SQL learning repository covering SQL fundamentals, advanced SQL concepts, database design, and practical projects.
The goal of this repository is to build a strong foundation in SQL and progressively move toward advanced querying and real-world database problem solving.
| Day | Topics | Status |
|---|---|---|
| Day 1 | SQL Basics, DDL, DML, SELECT, Filtering, Sorting, Aggregations, GROUP BY, HAVING, Joins | Cpmpleted |
| Day 2 | Window Functions, Views, Indexes | Completed |
| Day 3 | CTEs, Subqueries | Completed |
| Day 4 | Database Normalization & Database Design | Completed |
| Day 5 | SQL Project | Upcoming |
SQL/
│
├── README.md
│
├── day-1/
│ ├── SQL_Basics.sql
│ └── README.md
│
├── day-2/
│ ├── Winodow_Function_Index.sql
│ └── README.md
│
├── day-3/
│ ├── SQL_CTE_Subqueries.sql
│ └── README.md
│
├── day-4/
│ ├── normalization.sql
│ └── README.md
│
└── day-5/
├── project.sql
└── README.md
Each day contains:
- SQL file → Queries, examples, and practice
- README.md → Concepts, syntax, explanations, and important notes
-
Introduction to SQL
-
Database fundamentals
-
Tables, rows, columns
-
DDL — Data Definition Language
CREATEALTERDROPTRUNCATE
-
DML — Data Manipulation Language
INSERTUPDATEDELETE
-
DQL
SELECT
-
Filtering
WHEREANDORBETWEENIS NULLIS NOT NULLLIKE
-
Sorting
ORDER BY
-
DISTINCT -
LIMIT -
Aggregate Functions
COUNT()SUM()AVG()MIN()MAX()
-
GROUP BY -
HAVING -
Joins
INNER JOINLEFT JOINRIGHT JOINFULL OUTER JOINCROSS JOINSELF JOIN
-
Primary Keys
-
Foreign Keys
-
Constraints
-
Window Functions
ROW_NUMBER()RANK()DENSE_RANK()LAG()LEAD()FIRST_VALUE()LAST_VALUE()PARTITION BYORDER BYinside windows
-
Views
- Creating views
- Updating/removing views
- Use cases
-
Indexes
- What is an index?
- Creating indexes
- Benefits and drawbacks
- When to use indexes
-
Subqueries
- Scalar subqueries
- Single-row subqueries
- Multi-row subqueries
- Correlated subqueries
INEXISTS
-
Common Table Expressions (CTEs)
WITH- Multiple CTEs
- Recursive CTEs
-
CTE vs Subquery
-
Practical query optimization
-
Database Design
-
Data Redundancy
-
Data Anomalies
- Insert anomaly
- Update anomaly
- Delete anomaly
-
Normalization
- 1NF — First Normal Form
- 2NF — Second Normal Form
- 3NF — Third Normal Form
- BCNF
-
Primary Keys
-
Candidate Keys
-
Composite Keys
-
Foreign Keys
-
Relationships
- One-to-One
- One-to-Many
- Many-to-Many
-
Entity Relationship concepts
The final stage will combine the concepts learned throughout the previous days into a practical SQL project.
- Database design
- Multiple related tables
- Primary & foreign keys
- Constraints
- Data insertion
- Data cleaning
- Joins
- Aggregate functions
GROUP BYHAVING- Subqueries
- CTEs
- Window functions
- Views
- Indexes
- Business-oriented SQL queries
- Analysis and insights
By completing this repository, I aim to be able to:
- Write SQL queries confidently
- Design relational databases
- Work with multiple related tables
- Perform data aggregation and analysis
- Write complex queries using CTEs and subqueries
- Use window functions for analytical problems
- Understand database normalization
- Understand indexes and query performance
- Solve SQL interview problems
- Apply SQL to real-world datasets and projects
The examples and practice queries in this repository primarily use:
PostgreSQL
Some syntax may differ between PostgreSQL, MySQL, SQL Server, and Oracle.
Day 1 ████████████ SQL Fundamentals
Day 2 ████████████ Window Functions / Views / Indexes
Day 3 ████████████ CTEs / Subqueries
Day 4 ████████████ Normalization / Database Design
Day 5 ░░░░░░░░░░░░ Project
This repository follows a learn → write → practice → apply approach.
Each topic is documented with:
- Concept
- Syntax
- Example
- Practice queries
- Real-world use cases
The final project will bring the concepts together into one practical database and analysis workflow.
Potential topics to add later:
- Transactions
- ACID Properties
- Stored Procedures
- Functions
- Triggers
- Query Optimization
EXPLAIN/EXPLAIN ANALYZE- Database Transactions
- Advanced PostgreSQL features
- SQL Interview Questions
- LeetCode / HackerRank SQL Practice
- Repository setup
- Day 1 — SQL Basics
- Day 2 — Window Functions, Views & Indexes
- Day 3 — CTEs & Subqueries
- Day 4 — Normalization & Database Design
- Day 5 — SQL Project
- Final review & interview practice