Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
T-SQL Data Analysis with Stored Procedures: Intermediate
New

T-SQL Data Analysis with Stored Procedures: Intermediate

CTEs, window functions, views, functions, error handling, transactions and reporting procedures in SQL Server
Last updated 11/2026
English
English

What you'll learn

  • Write readable multi-step queries with common table expressions (CTEs)
  • Rank, compare and trend data with window functions, PARTITION BY and LAG
  • Use views, temporary tables and table variables as building blocks
  • Validate inputs with THROW and handle errors with TRY/CATCH and an error log
  • Return values from stored procedures with OUTPUT parameters
  • Build a monthly reporting table, a re-runnable load procedure and a management pack

Course content

7 sections • 27 lectures • 2h 58m total length
  • Welcome to the intermediate course4:01
  • Set up, and the format functions17:16
  • Section 1 quiz

Requirements

  • Comfortable with SELECT, WHERE, GROUP BY and JOIN (the beginner course covers these)
  • A Windows PC (or cloud/virtual machine) with the free SQL Server Developer edition and SSMS

Description

This course contains the use of artificial intelligence.

Take your T-SQL from simple queries to professional, reliable reporting, with every technique written inside a stored procedure that anyone can run again with one line. Using Protea Bank, a realistic fictional South African bank database with 12 branches, 600 customers and 60,000 transactions, you'll learn the techniques analysts and report developers use every day in SQL Server.

Every lecture starts with a topic and a question, there's a comment above every line of code, and every result is read through with you. You'll see each procedure, view, function and table appear in Object Explorer as you create it, and every new table opened while it's empty, then again after it's filled. Money is shown in rand with your own format functions, while all calculations and sorting run on the real numbers.

You'll learn to:

  • Write your own functions to format money, numbers and percentages
  • Write readable, step-by-step queries with common table expressions (CTEs)
  • Rank, compare and trend data with window functions: ROW_NUMBER, RANK, DENSE_RANK, PARTITION BY, running totals, moving averages, LAG and LEAD
  • Reuse logic with views and table-valued functions, and hold results in temporary tables and table variables
  • Write robust stored procedures that check inputs with THROW, handle errors with TRY/CATCH and an error log table, and return values through OUTPUT parameters
  • Keep changes safe with transactions: BEGIN, COMMIT and ROLLBACK
  • Design a monthly reporting table, load it with a re-runnable procedure, and load the history with a WHILE loop
  • Build a monthly management pack procedure that returns three result sets

What's included:

  • 26 practical lectures recorded in SQL Server Management Studio, with real results
  • The Protea Bank setup script and a script for every lecture
  • 10 practice exercises with answers, and practice lectures that solve them step by step
  • A quiz after every main section

This course follows on from the beginner course, but you can start here if you're comfortable with SELECT, WHERE, GROUP BY and JOIN. All names, account numbers and figures are fictional. The narration uses an AI-generated voice.

Who this course is for:

  • Analysts and report writers who already know basic SQL
  • Students of the beginner course who want to go further
  • Finance, banking and operations staff who build regular reports
  • Anyone preparing for a data analyst or BI developer role