SQL Server T-SQL in Practice: Joins, CTEs, Procedures & Error Handling
Work through real T-SQL for a fictional parts wholesaler: joins and their traps, variables, CASE, CTEs and recursion, IF and WHILE, stored procedures with OUTPUT parameters, transactions, TRY/CATCH, temp tables, the OUTPUT clause and MERGE, with every answer checked as you go.
- One-time payment
- Instant access right after payment
- Secure checkout with Stripe
About this course
SQL Server T-SQL in Practice takes you from queries to real database code. Working for a fictional spare-parts wholesaler, you predict exactly what T-SQL returns or changes: LEFT JOIN filters in ON versus WHERE, row multiplication across joins, variable assignment, DATEDIFF boundaries, CASE, subqueries and the NOT IN NULL trap, CTEs, ROW_NUMBER and recursive CTEs. Then you trace IF and WHILE logic, call stored procedures with defaults, OUTPUT parameters and return codes, follow transactions and TRY...CATCH, stage data in temp tables, audit changes with the OUTPUT clause and synchronise stock with MERGE. Every answer is checked instantly, and the first lesson is free.
Lessons
- T-SQL Query Anatomy: Schemas, TOP and Logical OrderFree
- INNER vs LEFT JOIN and the ON-versus-WHERE Trap Locked
- LEFT JOIN + GROUP BY: COUNT, ISNULL and Honest Averages Locked
- Three-Table Joins and the Row-Multiplication Trap Locked
- Variables: DECLARE, SET and SELECT Assignment Locked
- Dates in T-SQL: DATEADD, DATEDIFF and EOMONTH Locked
- CASE and IIF: Turning Rules into Columns Locked
- Subqueries: Scalar, EXISTS and the NOT IN NULL Trap Locked
- CTE Basics: Name a Step, Use It Twice Locked
- ROW_NUMBER in a CTE: Latest per Group and Running Totals Locked
- Recursive CTEs: Exploding a Bill of Materials Locked
- Recursive CTEs as Generators: A Calendar of Days Locked
- IF...ELSE and BEGIN...END: Control Flow Locked
- WHILE Loops, BREAK, CONTINUE and @@ROWCOUNT Locked
- Stored Procedures: Parameters, Defaults and EXEC Locked
- OUTPUT Parameters and RETURN Codes Locked
- Temp Tables and Table Variables: A Staging Script Locked
- Transactions: BEGIN TRAN, COMMIT, ROLLBACK and @@TRANCOUNT Locked
- TRY...CATCH, XACT_STATE and Atomic Statements Locked
- The OUTPUT Clause: inserted, deleted and Audit Trails Locked
- MERGE: Insert, Update and Delete in One Statement Locked
- Final Project: A Robust Nightly Stock Sync Procedure Locked