Session 1: SQL Refresher – Basics of Querying
Objective: Solidify foundation before moving to advanced topics.
Topics Covered:
● Basic SELECT syntax
● WHERE conditions
● Sorting using ORDER BY
● Filtering using IN, BETWEEN, LIKE, IS NULL
Hands-on:
● Practice queries on employee or product dataset
● 8–10 simple queries
Session 2: Aggregation and Grouping
Objective: Master aggregate functions and grouped queries.
Topics Covered:
● COUNT, SUM, AVG, MIN, MAX
● GROUP BY and HAVING clauses
● Filtering after aggregation
Hands-on:
● Example use case: Find department-wise average salaries, total orders per customer
● Practice on LeetCode / SQLBolt
Session 3: Introduction to JOINs
Objective: Understand the concept of joining tables.
Topics Covered:
● Introduction to relational joins
● INNER JOIN and LEFT JOIN
● Real-world example: Employees and Departments
Hands-on:
● 5–6 queries using different join conditions
● Troubleshoot common JOIN issues (nulls, duplicates)
Session 4: Advanced JOINs and SELF JOIN
Objective: Cover other types of joins and practice edge cases.
Topics Covered:
● RIGHT JOIN, FULL OUTER JOIN
● CROSS JOIN
● SELF JOIN (e.g., employee-manager hierarchy)
Hands-on:
● Complex multi-table joins
● Practice with data modeling scenario (e.g., products, suppliers, categories)
Session 5: Subqueries
Objective: Learn nesting queries inside main queries.
Topics Covered:
● Subqueries in SELECT, FROM, and WHERE
● Scalar vs Table subqueries
● Correlated vs Non-Correlated subqueries
Hands-on:
● Use case: Find employees earning more than average salary
● Practice 5–6 subqueries
Session 6: Common Table Expressions (CTEs)
Objective: Write modular and readable queries using CTEs.
Topics Covered:
● WITH clause
● Recursive CTEs (brief intro)
● Differences between CTE and subquery
Hands-on:
● Practice rewriting subqueries as CTEs
● Example: Department-wise salary banding
Session 7: Data Definition Language (DDL)
Objective: Learn how to create and modify schema elements.
Topics Covered:
● CREATE TABLE, ALTER TABLE
● DROP, TRUNCATE
● Column data types, naming conventions
Hands-on:
● Create 2–3 tables from scratch with constraints
● Add columns and modify data types
Session 8: Constraints and Data Integrity
Objective: Understand how databases enforce rules.
Topics Covered:
● PRIMARY KEY, FOREIGN KEY
● NOT NULL, UNIQUE, DEFAULT, CHECK
● Referential integrity
Hands-on:
● Define relationships between tables (e.g., orders and customers)
● Practice INSERTs that violate constraints and handle errors
Session 9: Data Manipulation Language (DML)
Objective: Work with CRUD operations.
Topics Covered:
● INSERT INTO
● UPDATE with WHERE clause
● DELETE with WHERE clause
● Bulk updates using joins or subqueries
Hands-on:
● Populate sample tables
● Perform updates with conditions (e.g., bonus for employees)
Session 10: Stored Procedures and SQL Variables
Objective: Encapsulate logic and introduce reusability.
Topics Covered:
● DECLARE, SET, BEGIN...END
● IN, OUT, INOUT parameters
● Conditional logic: IF...ELSE, CASE
Hands-on:
● Write 2 stored procedures: one to fetch employee data by dept, another to update salary
● Execute with parameters and debug
Session 11: Views, Indexes, and Triggers
Objective: Learn non-query-based SQL elements.
Topics Covered:
● CREATE VIEW, DROP VIEW
● Introduction to indexes (clustered vs non-clustered)
● CREATE TRIGGER: BEFORE / AFTER INSERT / UPDATE
Hands-on:
● Create a view for active customers
● Create a trigger to log changes on a table