📣 Turn SQL into real database programming power.
📘 Database – Level 2 (Concepts & T-SQL)
Advanced SQL logic, control flow, and performance thinking for real systems
🗝️ About This Course
This is the twenty-first course in your programming journey, after:
1️⃣ Programming Foundations – Level 1
2️⃣ Algorithms & Problem Solving – Level 1
3️⃣ Introduction to Programming with C++ – Level 1
4️⃣ Algorithms & Problem Solving – Level 1 (Clean Code Solutions)
5️⃣ Algorithms & Problem Solving – Level 2
6️⃣ Introduction to Programming Using C++ – Level 2
7️⃣ Algorithms & Problem Solving – Level 3
8️⃣ Algorithms & Problem Solving – Level 4
9️⃣ Foundations – Level 2
🔟 OOP as it Should Be – Concepts
1️⃣1️⃣ OOP as it Should Be – Applications
1️⃣2️⃣ Data Structures – Level 1
1️⃣3️⃣ Algorithms & Problem Solving – Level 5
1️⃣4️⃣ C# – Level 1
1️⃣5️⃣ Database – Level 1 (SQL: Concepts & Practice)
1️⃣6️⃣ OOP as It Should Be in C#
1️⃣7️⃣ Database – SQL (Projects & Practice)
1️⃣8️⃣ C# & Database Connectivity (ADO.NET)
1️⃣9️⃣ Full Real Project – DVLD
2️⃣0️⃣ C# Programming – Level 2
At this point in the roadmap, you already:
🔹 Design databases correctly (ERD → relational schema)
🔹 Write solid SQL queries and joins with confidence
🔹 Apply normalization, constraints, and data integrity
🔹 Use ADO.NET to connect applications to databases
🔹 Build real systems and handle real data flows
🔹 Understand architecture, performance awareness, and clean code
Now it’s time to move SQL from querying to programming.
👉 This course takes you inside T-SQL — where logic, control flow, transactions, and performance live.
🔐 What Makes This Course Different?
🔹 Treats T-SQL as a programming language, not just query syntax
🔹 Teaches logic, flow control, and error handling inside the database
🔹 Focuses on correctness, safety, and performance
🔹 Explains when to use database logic and when not to
🔹 Builds skills required for enterprise and backend systems
This course fixes a common limitation:
👉 Knowing SELECTs and JOINs, but not knowing how databases think and execute logic.
📖 What You Will Learn?
By the end of this course, you will be able to:
🔹 Write procedural logic in T-SQL using:
▫️ Variables
▫️ IF / ELSE
▫️ CASE statements
▫️ WHILE loops and control blocks (BEGIN…END)
🔹 Handle errors and safety correctly:
▫️ TRY…CATCH
▫️ THROW and error functions
▫️ @@ERROR and @@ROWCOUNT
🔹 Control data consistency with:
▫️ Transactions (COMMIT / ROLLBACK)
▫️ Real banking-style examples
🔹 Work with temporary data:
▫️ Table variables
▫️ Temporary tables
▫️ When to use each correctly
🔹 Build reusable database logic using:
▫️ Stored Procedures (CRUD patterns)
▫️ Scalar functions
▫️ Inline and multi-statement table-valued functions
🔹 Use advanced querying features:
▫️ Window functions (ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD)
▫️ Paging with OFFSET / FETCH
▫️ CTEs (including recursive CTEs)
🔹 Implement database automation:
▫️ Triggers (AFTER / INSTEAD OF)
▫️ Inserted & Deleted tables
🔹 Understand security and safety:
▫️ Dynamic SQL and SQL Injection
▫️ Safer patterns and best practices
🔹 Begin performance-aware thinking:
▫️ Indexing basics
▫️ Execution plans
▫️ Query optimization concepts
🧱 How This Course Is Structured?
🔹 Starts with T-SQL fundamentals and control flow
🔹 Moves into error handling and transactions
🔹 Introduces reusable database components
🔹 Advances to window functions, CTEs, and triggers
🔹 Ends with performance, security, and best practices
📌 The goal is confidence and control, not memorization.
🧑💻 Who This Course Is For?
✅ Students who completed Database – Level 1 and SQL Projects & Practice
✅ Backend developers building serious systems
✅ Developers who want logic where it belongs — inside the database
✅ Data Analysts who need advanced SQL logic and window functions
✅ Data Scientists & AI engineers working with complex datasets and transformations
✅ Anyone aiming for enterprise-grade database skills
❌ Not for beginners or syntax-only learners
⚠️ What This Course Is NOT?
❌ Not a beginner SQL course
❌ Not a replacement for application logic
❌ Not about writing logic everywhere without design thinking
📌 This course teaches when and how to use T-SQL responsibly.
🎓 Certification & Learning Outcomes
Upon completion, you will earn a
Certificate in Database – Level 2 (Concepts & T-SQL), validating your ability to:
🔹 Write advanced T-SQL logic safely
🔹 Build reusable database components
🔹 Handle transactions and errors correctly
🔹 Apply performance-aware database design
🎓 Final Outcome
After completing this course, you will:
🔹 Treat SQL as a real programming skill
🔹 Write safer, faster, and smarter database logic
🔹 Understand how databases execute and optimize work
🔹 Be ready for enterprise databases, analytics, and backend systems
🧠 Level 1 taught you how to query data. Level 2 teaches you how databases actually think.
Course Content
- WHILE Loops - Example 1 - Simple Counter (2:47)
- Example 2: Iterating Over a Table (4:01)
- 03 Example 3 - Loop with Conditional Exit (2:24)
- Example 4 - Nested While Loops - 10 x 10 Multiplication Table (2:35)
- Example 5 - 10 x 10 Matrix Multiplication Table (2:15)
- Example 6 - BREAK and CONTINUE Statements (3:47)
- Important: There is No For Loop or Do While Statement In T-SQL
- Quiz
- Stored Procedures in T-SQL (12:56)
- CREATE: Add a New Person SP. (6:06)
- READ: Get All People (2:20)
- READ: Get Person By ID way 1 (2:06)
- READ: Get Person By ID way 2 (5:02)
- UPDATE: Update a Person's Details (1:39)
- DELETE: Remove a Person (1:11)
- RETURN Statement (3:00)
- Drop SP (1:33)
- SP_HELPTEXT command. (1:35)
- Quiz
- What is Window Functions? (3:32)
- Understanding the ROW_NUMBER() Function in SQL (4:51)
- Understanding the RANK() Function in SQL (3:52)
- Understanding the Difference Between RANK and DENSE_RANK in SQL (2:34)
- Using the RANK() Function with PARTITION BY in SQL (4:09)
- Aggregate Functions with Partition (2:28)
- Exploring LAG and LEAD Functions Using a Single SQL Query (4:16)
- Paging in SQL using OFFSET and FETCH NEXT (10:16)
- Quiz
- Common Table Expressions (CTEs) in T-SQL (10:17)
- Recursive CTE Example 1 (3:21)
- Understanding Recursive CTEs for Building Employee Hierarchies (8:20)
- Generating a Date Series Using CTE (3:12)
- Identifying Duplicate Records Using CTE in T-SQL (3:23)
- Ranking Items Using CTE (2:51)
- Calculating Average Sales of Top Performing Employees Using CTE (3:03)
- Quiz