A personal repository to document and practice SQL concepts from scratch β one topic at a time.
This repo is my hands-on SQL practice space. As I learn new concepts β from basic queries to advanced joins and subqueries β I commit my practice files here to track my progress and build a reference I can revisit.
Learning approach: Topic-by-topic, with dedicated .sql files for each concept and real practice queries.
| File | Topics Covered |
|---|---|
1. BASIC SQL.sql |
CREATE, DROP, INSERT, PRIMARY KEY, data types |
2. SELECT SQL.sql |
SELECT, WHERE, ORDER BY, LIMIT, DISTINCT, aggregate functions |
3. Update and Delete.sql |
UPDATE, DELETE, WHERE conditions, safe delete patterns |
4. FOREIGN_KEY AND CASCADE.sql |
Foreign key constraints, ON DELETE CASCADE, referential integrity |
5. Alter.sql |
ALTER TABLE β adding/dropping/modifying columns, renaming tables |
6. JOINS.SQL |
INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL OUTER JOIN, SELF JOIN |
7. SUB QUERIES AND VIEWS.SQL |
Subqueries, nested SELECT, CREATE VIEW, using views |
8. ADVANCED SQL.SQL |
Indexes, Window Functions, CTEs, Stored Procedures, Transactions |
- Basic DDL & DML β CREATE, INSERT, DROP
- SELECT queries & filtering
- UPDATE & DELETE operations
- Foreign keys & CASCADE behavior
- ALTER TABLE operations
- All types of JOINs
- Subqueries & Views
- Advanced SQL (added)
- π Indexes & Query Optimization (in progress)
- π Stored Procedures & Functions (in progress)
- π Transactions & ACID properties (in progress)
- π Window Functions (
ROW_NUMBER,RANK,PARTITION BY) (in progress) - π CTEs (Common Table Expressions) (in progress)
- Database: MySQL / PostgreSQL (compatible with both)
- Client: MySQL Workbench /
cqlsh/ DBeaver - Editor: VS Code with SQL extensions
If you're also learning SQL, feel free to clone and run these files locally:
git clone https://github.com/Swarajbabu/SQL_LEARNING.gitOpen any .sql file in your preferred client (MySQL Workbench, DBeaver, or the terminal) and execute the queries to see them in action.
- Files are numbered in the order they should be studied.
- Each file is self-contained with comments explaining what each query does.
- This repo is actively updated as I progress through new topics.
Swaraj Babu B.Tech CSE | Lovely Professional University (2023β2027) Focused on: ML Β· Data Engineering Β· MLOps Β· GenAI
β If this helps you learn SQL too, drop a star!