Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
T-SQL Expert: Complete Microsoft SQL Server Training
Highest Rated
Rating: 4.5 out of 5(16 ratings)
237 students

T-SQL Expert: Complete Microsoft SQL Server Training

Learn T-SQL from scratch with 146+ hands-on lectures covering queries, joins, functions, stored procedures & performance
Created byVitalii Shumylo
Last updated 8/2026
English
English [Auto],

What you'll learn

  • Write advanced T-SQL queries with complex joins, subqueries, window functions, and set operations to solve real-world business problems efficiently.
  • Create and manage stored procedures with dynamic SQL, parameter handling, error management, and transaction control for robust database applications.
  • Master SQL Server data types, built-in functions, views, CTEs, and performance optimization techniques to build high-performing database solutions.
  • Query system catalogs, analyze performance data, and implement best practices for T-SQL programming and database administration tasks.

Course content

1 section146 lectures20h 54m total length
  • Installing Microsoft Windows Server4:43

    Install Windows Server in Hyper-V to prepare for SQL Server, create a virtual machine, enable Hyper-V features, and choose the GUI edition of Windows Server 2022.

  • Installing Microsoft SQL Server6:21

    Install and configure Microsoft SQL Server on a local server, including downloading SQL Server on premises, installing management tools, and setting up Git and Visual Studio Code.

  • Installing Sample Database3:43

    Download the Adventureworks Lt 2022 sample database from the Microsoft SQL samples repository and restore it on your local server using SQL Server Management Studio.

  • About T-SQL6:12

    Explore the basics of T-SQL and its set-based, declarative approach to writing queries for SQL Server. Identify predicates, operators, expressions, and commands as core language elements.

  • Introduction to T-SQL: Elements, Categories, and Basic Concepts9:09

    Explore the T-SQL language elements, including DML, DDL, DCL, predicates, operators, functions, expressions, and variables, and learn how to organize queries with select, insert, update, and delete.

  • Demo Example: Queries using fundamental T-SQL elements8:45

    Develop and practice fundamental T-SQL queries in Adventureworks by using select, where, like, in, and between clauses in SSMS, including executing queries and handling batches.

  • Introduction to T-SQL: Expressions, Comment, Batch Separators6:51

    Master expressions, comments, and batch separators in t-sql, and learn to use variables and basic control flow to build robust queries and manage code in batches.

  • Demo Example 1: T-SQL Expressions and Control Flow Basics7:50

    Explore T-SQL expressions and control flow basics to enhance queries on sales.orders, using year extraction, date add, and order by order date descending, while troubleshooting syntax errors.

  • Demo Example 2: T-SQL Expressions and Control Flow Basics15:16

    Learn t-sql control flow with if-else and begin-end blocks in stored procedures or triggers, to categorize orders by year, while debugging schema errors and using date diff.

  • Sets and SQL Server6:12

    Learn to think in sets for T-SQL, using set-based processing over procedural code, ensuring unique identifiers and proper ordering with order by to optimize SQL Server queries.

  • Hands-On demo Example: Sets and SQL Server6:29

    Learn how sets drive efficient sql server queries with practical examples in the Adventureworks database, including top n selects, defining primary keys, and set based grouping and ordering.

  • T-SQL Column Aliases on Naming Conventions and Best Practices6:31

    Learn how T-SQL column aliases boost readability, compare aliasing methods using as, equals, or direct assignment, and apply best practices for descriptive, consistent names and comma placement.

  • T-SQL Sales Analysis with Column Aliases and Price Calculations10:10
  • SQL Query Structure in Business Report Analysis Example9:06

    Learn to structure a business report query by joining the sales order header with territory, salesperson, and person tables using select, join, group by, and order by.

  • Using 'AS' in Business Report Generation Example with SQL6:35

    Master practical business reporting in T-SQL by aliasing columns with as, concatenating salesperson names, and calculating total orders, subtotal, tax, and average order size on AdventureWorks 2022.

  • Using CASE Expressions in SELECT Clauses5:47

    Explore simple case expressions in T-SQL to substitute values and apply conditional logic in select clauses, alias the result, and replace numeric codes with descriptive labels.

  • Demo: Writing Simple CASE Expressions9:25

    Master simple case expressions with the Adventureworks 2022 database to categorize total due as low, medium, or high in the sales order header table, using where and order by.

  • Lab Tasks: Writing Basic SELECT Statements9:03

    Learn basic T-SQL querying in the Adventureworks 2022 database by writing simple select statements and retrieving specific columns, using distinct, aliases, and case expressions to classify products and campaigns.

  • Lab Solution Demo: Writing Basic SELECT Statements12:50

    Practice writing basic T-SQL select statements against the AdventureWorks 2022 database to retrieve data, learning to specify columns, use distinct and aliases, and apply case expressions for data categorization.

  • Knowledge Check: Writing Basic SELECT Statements4:59

    Master basic select statements by applying distinct to remove duplicates, using table and column aliases, and implementing case expressions to categorize and clarify query results for readability.

  • Understanding Joins. The FROM Clause and Virtual Tables8:24

    Explore how the from clause creates virtual tables and use aliases for clean references. Distinguish inner, outer, self, and cross joins, and avoid cartesian products with ansi sql 92 syntax.

  • Demo: Understanding Joins. The FROM Clause and Virtual Tables11:55

    Explain the from clause and virtual tables, apply aliases, and build joins, including inner joins and self-joins on AdventureWorks employees, while avoiding cartesian products and using get ancestor for managers.

  • Overview of Join Types. Cartesian Product. T-SQL Syntax Choices8:57

    Explore cartesian products, join types, and T-SQL syntax choices for efficient multi-table queries. Learn inner, outer, and cross joins, and why SQL 92 on clauses reduce accidental cartesian products.

  • Demo: T-SQL Syntax Choices9:03

    Compare Ansi SQL 89 and Ansi SQL 92 join syntax to avoid accidental cartesian products, using explicit on clauses and join keywords for clearer, safer, and more efficient queries.

  • Demo: Cartesian Product and Join Types11:54

    Explore cartesian products and join types in T-SQL using the Adventureworks 2022 database, including inner, outer, and self-joins, with best practices for efficient multi-table queries.

  • Querying with Inner Joins9:16

    Master inner joins to query data across multiple tables, using on and where clauses, ansi sql 92 syntax, aliases, and both single and composite joins for accurate results.

  • Demo 1: Querying with Inner Joins13:09

    Explore inner joins in SQL using practical examples, including simple, composite, and multi-table joins; use aliases and distinct to retrieve only matching rows across customers, orders, and details.

  • Demo 2: Querying with Inner Joins12:38

    Master inner joins using the Adventureworks 2022 database to join customer, orders, and product data. Learn simple and composite joins with on and where clauses to filter results.

  • Querying with Outer Joins10:20

    Explore the purpose and function of outer joins, including left, right, and full joins, and learn to write queries that preserve rows and use null tests to reveal unmatched data.

  • Demo 1: Querying with Outer Joins10:40

    Discover how outer joins preserve unmatched rows and fill missing data with null values in T-SQL, and learn left and right outer joins, inner joins, using Adventureworks.

  • Demo 2: Querying with Outer Joins7:40

    Demonstrate left, right, and full outer joins on the Adventureworks 2022 database to preserve unmatched rows with nulls and identify customers without orders using null tests.

  • Querying with Cross Joins and Self Joins8:04

    Explore cross joins and self joins in SQL to generate all row combinations, support test data and lookup table creation, and compare rows within the same table.

  • Demo 1: Querying with Cross Joins and Self Joins7:44

    Master cross joins and self joins in SQL Server with the Adventureworks 2022 database, using the cross join operator to generate cartesian products for test data and lookups.

  • Demo 2: Querying with Cross Joins and Self Joins6:33

    Explore self joins and cross joins in T-SQL with practical examples that link employees to their managers and generate all row combinations, including unmatched cases.

  • Sorting Data5:58

    Learn to control query result order with the order by clause, sorting by columns (asc or desc), handling nulls, and using multiple columns as tiebreakers with collate options.

  • Demo: Sorting Data7:18

    Explore how to sort query results with the order by clause, including sorting by columns, calculated aliases, and multiple columns with ascending or descending order.

  • Filtering Data with Predicates6:36

    Explore how to filter data with predicates in the where clause, using logical conditions and operators like in, between, and like to return only rows that evaluate to true.

  • Demo: Filtering Data with Predicates9:30

    Learn to filter query results with the where clause using predicates and a range of operators, including or, in, and not in, with examples on dates and strings.

  • Filtering Data with TOP and OFFSET-FETCH7:27

    Learn to filter ranges of rows with the top option and offset fetch, using order by, with ties, and paging for deterministic results.

  • Demo: Filtering Data with TOP and OFFSET-FETCH9:55

    Use top to retrieve a fixed number or percentage of rows with a deterministic order by and with ties. Apply offset fetch for pagination by skipping and fetching ranges.

  • Working with Unknown Values5:05

    Master three-valued logic in sql, where true, false, and unknown govern comparisons with nulls. Test nulls with is null or is not null, and where and order by treat nulls.

  • Demo: Working with Unknown Values7:56

    Explore how null values behave in SQL Server and how to include or exclude them with is null and is not null, while understanding default sorting of nulls.

  • Introducing SQL Server Data Types8:38

    Explore SQL Server data types, including exact numeric, approximate numeric, binary strings, and special types, with emphasis on type precedence, conversions, storage, precision, and performance.

  • Other Data Types6:01

    Explore approximate numeric types such as float and real for large ranges with reduced precision; review binary types binary and varbinary, and note raw version, unique identifier, and XML.

  • Demo: Introducing SQL Server Data Types12:14

    Explore SQL Server data types across numeric, character, and temporal categories using the Adventureworks 2022 database, and learn how type precedence drives implicit and explicit conversions.

  • Demo: When Are Data Types Converted?6:13

    Learn how SQL Server handles implicit conversions and when to use explicit conversions with cast or convert, guided by precedence rules. Ensure reliable operations and prevent errors in T-SQL.

  • Working with Character Data12:18

    Explore character data in SQL Server, covering non-Unicode and Unicode types, collation, and case sensitivity, plus string concatenation, and text functions like substring, charindex, replace, and format.

  • Demo: Working with Character Data13:07

    Learn to work with character data in SQL Server, covering collation and case sensitivity, string concatenation with plus and concat, and built-in string functions and like pattern matching.

  • Working with Date and Time Data10:46

    Explore SQL Server date and time data types, literals, and built-in functions to store, manipulate, and query temporal data, including handling partial values, time zones, and range queries.

  • Demo: Working with Date and Time Data15:19

    Explore how to work with date and time data in SQL Server by using current and UTC date functions, extracting parts, constructing values from components, calculating differences, and validating inputs.

  • Adding Data to Tables7:14

    Learn to add data to tables in SQL Server using T-SQL with insert, insert into, insert into select, and select into; leverage table value constructor for multi-row inserts.

  • Demo: Adding Data to Tables9:17

    Master the insert statement in SQL Server to add data to tables, from single rows to bulk inserts using insert into select; ensure matching columns and data types.

  • Modifying and Removing Data7:23

    Modify and remove data in SQL Server using update, merge, delete, and truncate table with where clauses, joins, and upserts for precise data management.

  • Demo: Modifying and Removing Data16:10

    Learn to modify and remove data in SQL Server using update, merge, delete, and truncate table, with practical examples and guidance on where clauses and upserts.

  • Generating Numbers6:35

    Explore generating numbers in SQL Server using the identity property and the sequence object, including syntax, use cases, constraints, and cross-table coordination for unique identifiers and sequential values.

  • Writing Queries with Built-In Functions9:55

    Explore built in functions in SQL Server, focusing on scalar functions like abs and dbname, grouped aggregates, window functions, and rowset tools such as open query and open row set.

  • Demo: Writing Queries with Built-In Functions9:05

    Master built-in SQL Server functions, including scalar, aggregate, and ranking functions, with practical examples on date parts, absolute values, data type casting, counts, sums, and rankings.

  • Using Conversion Functions8:56

    Explore implicit and explicit data type conversions in SQL Server, using cast, convert, parse, and try parse and try convert, with culture codes and formatting for robust, error-free queries.

  • Demo: Using Conversion Functions8:37

    Explore data type conversions in SQL Server using cast, convert, parse, and try_parse to format dates, convert strings, and handle invalid input gracefully.

  • Using Logical Functions6:18

    Explore how to use SQL Server logical functions to validate data, test conditions, and map values from a predefined list with is numeric, iif, and choose.

  • Demo: Using Logical Functions7:22

    Explore SQL Server logical functions for data validation and conditional testing with is numeric, iif, and choose. Learn to map numeric indices to labels and handle non-numeric inputs in queries.

  • Functions to Work with NULL5:26

    Learn to handle null values in SQL Server by using isnull to replace nulls, coalesce to return the first non-null value, and nullif to conditionally generate nulls in queries.

  • Demo: Functions to Work with NULL12:09

    Learn to manage null values in SQL Server with isnull, coalesce, and nullif. Replace nulls with a value, return the first non-null value from expressions, and generate nulls when appropriate.

  • Using Aggregate Functions9:55

    Explore built-in aggregate functions in SQL Server to summarize data across rows, including sum, avg, min, max, and count, while handling nulls and using distinct and group by.

  • Demo 1: Using Aggregate Functions9:14

    Master using aggregate functions in SQL Server to summarize data across rows, calculating totals, averages, and counts while handling group by, nulls, and distinct.

  • Demo 2: Using Aggregate Functions12:10

    Explore null handling in aggregate functions, comparing sum, count, and avg and contrasting arithmetic versus non-null averages. Replace nulls with zero before aggregating, noting distinct implications.

  • Using the GROUP BY Clause9:03

    Learn how to use the group by clause to group rows by columns, apply aggregates like count, sum, and max, and analyze data per group with correct query ordering.

  • Demo: Using the GROUP BY Clause10:28

    Learn to use the group by clause in SQL Server to group rows, apply aggregate functions, and analyze data at multiple granularities for reporting and trends.

  • Filtering Groups with HAVING7:40

    Understand how the having clause filters groups after group by, based on aggregate values like count and sum. Distinguish where versus having for row level and group level filtering.

  • Demo: Filtering Groups with HAVING12:26

    Discover how the having clause filters grouped data after group by, using aggregates such as count, sum, and average to return only meaningful groups.

  • Writing Self-Contained Subqueries8:51

    Master self-contained subqueries in t-sql by writing scalar and multi-valued examples, testing them independently, and comparing with joins for clearer, efficient queries.

  • Demo: Writing Self-Contained Subqueries10:16

    Explore scalar and multi-valued subqueries in T-SQL, including self-contained subqueries that run independently. Use max to fetch most recent orders, and apply in predicates or joins for readability and maintainability.

  • Writing Correlated Subqueries7:33

    Explore correlated subqueries in T-SQL by contrasting them with self-contained queries, understanding outer and inner query dependencies, and learning testing, debugging, and performance considerations.

  • Demo: Writing Correlated Subqueries12:20

    Discover how correlated subqueries in T-SQL depend on the outer query and execute per row for dynamic calculations, with notes on testing, debugging, and performance.

  • Using the EXISTS Predicate with Subqueries7:40

    Explore how the exists predicate accelerates existence tests in subqueries, compare it to count and not exists, and learn practical queries for matching and non-matching rows in SQL Server.

  • Demo: Using the EXISTS Predicate with Subqueries7:47

    Demonstrates the exists predicate with subqueries in SQL Server to test row existence. Shows not exists and compares exists with count for efficient filtering of customers with or without orders.

  • Using Views5:50

    Learn how to use views in SQL Server to query underlying tables, create reusable views with the create view statement, and leverage modularity, security, and API-like consistency.

  • Demo: Using Views12:39

    Learn to create and query views, from simple employee phone lists to complex multi-table sales by employee and year. Set context, reuse logic, and drop views to stay clean.

  • Using Inline TVFs6:28

    Master inline TVFs to encapsulate reusable logic and return parameterized virtual tables in SQL Server, enabling dynamic, modular queries that combine the reusability of views with function flexibility.

  • Demo: Using Inline TVFs9:24

    Learn to use and create user defined functions in SQL Server, including inline table valued functions that return a virtual table and compute order line totals, enabling modular, reusable queries.

  • Using Derived Tables8:58

    Master how to use derived tables to modularize complex queries by creating temporary virtual tables in the from clause, aliasing columns, passing arguments, and avoiding deep nesting.

  • Demo: Using Derived Tables13:01

    Explore derived tables in T-SQL and learn to use inline and external column aliases. Pass arguments to derived tables and nest queries for modular, readable code.

  • Using CTEs (Common Table Expressions)8:52

    Leverage with clause defined CTEs to modularize complex queries, reuse the CTE multiple times in the outer query, and compare their readability and flexibility with derived tables.

  • Demo: Using CTEs (Common Table Expressions)12:08

    Explore common table expressions (CTEs) to simplify complex SQL queries by creating a temporary result set, with non-recursive CTEs for modular queries and recursive CTEs for hierarchical data.

  • Writing Queries with the UNION Operator6:40

    Learn how to use the union and union all operators to combine rows from multiple queries, handle duplicates, and optimize performance in SQL Server.

  • Demo: Writing Queries with the UNION Operator4:59

    Learn to use union and union all in SQL Server to combine queries, control duplicates, and produce distinct versus all results for merging data from multiple sources.

  • Using EXCEPT and INTERSECT8:08

    Explore how intersect and except operators compare data sets in SQL Server, returning distinct rows that are common to both or unique to one set.

  • Demo: Using EXCEPT and INTERSECT5:06

    Explore the intersect and except operators in SQL Server to compare datasets, identify overlaps and differences, and understand how order affects results and duplicate elimination.

  • Using APPLY7:29

    Learn to use the apply operator in SQL Server, applying a TVF or derived table to each left row with cross apply or outer apply, and understand their filtering behavior.

  • Demo: Using APPLY15:45

    Explore the apply operator in SQL Server, using inline tvf with cross apply and outer apply to fetch top three products per supplier, and compare cross apply with auto apply.

  • Creating Windows with OVER9:35

    Explore the over clause in SQL Server to define windows for window functions, apply partitioning, ordering, and framing, and generate running totals, rankings, and row comparisons without self joins.

  • Demo 1: Creating Windows with OVER12:12

    Demonstrates using the over clause in t-sql to compute rankings and running totals within windows, then builds views to show ordering and partitioning by category and product data.

  • Demo 2: Creating Windows with OVER12:17

    Explore how to create windows with the over clause in SQL Server, using partition by, order by, and framing to compute running totals and cumulative sums.

  • Exploring Window Functions10:00

    Master window functions in SQL Server with the over clause. Explore aggregate, ranking, distribution, and offset functions using partitioning, ordering, and framing, including rank, dense rank, lead, and lag.

  • Demo 1: Creating Views for Exploring Window Functions Lab11:25

    Explore window functions for calculations across rows while preserving granularity and use views as reusable virtual tables to simplify complex queries in sql.

  • Demo 2: Creating Views for Exploring Window Functions Lab8:59

    Create views to simplify complex queries by joining employees, orders, and order details to calculate total sales per employee by year, enabling reuse for streamlined data analysis.

  • Demo 3: Exploring Window Functions Lab8:19

    Explore window functions in T-SQL by ranking products with rank and dense_rank over unit price, and compare gaps versus dense_rank for reporting.

  • Demo 4: Exploring Window Functions Lab8:43

    Explore window functions in SQL Server, including row_number, ntile, lag, and first_value, with category-based partitioning and unit price ordering. Learn ranking, bucketing, year-over-year comparisons, and cleanup of views.

  • Writing Queries with PIVOT and UNPIVOT6:18

    Learn to reshape data in T-SQL by applying pivot and unpivot to rotate rows into columns and back, using grouping, spreading, and aggregation for analysis.

  • Demo 1: Writing Queries with PIVOT and UNPIVOT6:12

    Learn to transform data with pivot and unpivot in T-SQL, rotating rows into columns and back while working with a sales category quantity year view.

  • Demo 2: Writing Queries with PIVOT and UNPIVOT11:25

    Learn to pivot and unpivot data in SQL Server by creating a staging table and producing a pivoted category sales view, then unpivot to restore rows across 2006–2008.

  • Querying Data with Stored Procedures8:33

    Learn how stored procedures encapsulate T-SQL logic to query data, execute them with exec and parameters, and deliver reusable, secure, and efficient result sets.

  • Demo 1: Querying Data with Stored Procedures5:35

    Learn how stored procedures in T-SQL are reusable, named collections of SQL statements that encapsulate logic for querying or manipulating data with a consistent interface and parameterized queries.

  • Demo 2: Querying Data with Stored Procedures7:11

    Enhance a stored procedure by using alter procedure to add a num rows parameter with a default, enabling top rows through parameterized execution, and finish by dropping the procedure.

  • Passing Parameters to Stored Procedures7:41

    Master passing input parameters to stored procedures and using output parameters to return scalar values in T-SQL, and explore parameter metadata with the system catalog or SQL Server Management Studio.

  • Demo 1: Passing Parameters to Stored Procedures3:33

    Explore how to work with stored procedure parameters in T-SQL, including input and output parameters, and discover definitions using SSMS and system catalog queries to write flexible, reusable queries.

  • Demo 2: Passing Parameters to Stored Procedures7:29

    Query SQL Server metadata to inspect parameters of functions and procedures using T-SQL, including variables and object joins, with guidance on input and output parameters.

  • Demo 3: Passing Parameters to Stored Procedures7:11

    Create and test a T-SQL stored procedure with an input parameter to filter products by supplier id, then modify it with alter proc and verify its existence.

  • Demo 4: Passing Parameters to Stored Procedures6:24

    Explore passing parameters to stored procedures in T-SQL, test with variable declarations and output parameters, handle batch scope with go, debug typos, and clean up by dropping procedures.

  • Demo 5: Passing Parameters to Stored Procedures9:07

    Learn how to create, alter, drop, and test stored procedures in t-sql, including organizing scripts, using separation lines, and verifying procedure existence.

  • Demo 6: Passing Parameters to Stored Procedures7:15

    Discover, define, and use input and output parameters in stored procedures, explore parameters graphically with SSMS, and retrieve parameter metadata from system catalog views.

  • Creating Simple Stored Procedures4:49

    Create simple stored procedures in T-SQL to encapsulate reusable SQL statements that return result sets and accept input parameters, enhancing performance, security, and maintainability.

  • Working with Dynamic SQL7:07

    Learn to construct and execute dynamic sql in t-sql, using sp_executesql for parameterized queries with improved security and performance, and compare it to the exec method for dynamic sql.

  • Demo 1: Working with Dynamic SQL6:05

    Master dynamic sql in t-sql by executing runtime queries, comparing the exact statement and sp execute sql stored procedure, and leveraging parameters and query plan reuse for security.

  • Demo 2: Working with Dynamic SQL5:12

    Explore dynamic sql using exec and sp execute sql with a parameterized string. Define parameter data types, pass values separately, and avoid input in query strings to prevent sql injection.

  • T-SQL Programming Elements10:39

    Learn to create and submit batches, declare and use variables, and work with synonyms in T-SQL, mastering batch boundaries, scope, and object aliases for flexible, efficient scripting.

  • Demo 1: T-SQL Programming Elements8:33

    Explore t-sql programming elements by working with batches, variables, and synonyms; learn to drop existing objects, create test tables, execute batches with go, and validate syntax to avoid errors.

  • Demo 2: T-SQL Programming Elements9:11

    Explore core T-SQL programming elements, including declaring and assigning variables with declare, set, and select, plus using synonyms and batch execution to manage scope and objects.

  • Controlling Program Flow8:34

    Explore T-SQL control flow to implement conditional logic and loops with if else, while, and begin end, using break, continue, wait for, and return to control execution.

  • Demo1: Controlling Program Flow6:14

    Explore control flow in T-SQL by using if-else and exists to conditionally execute blocks and handle procedure creation, drops, and messaging.

  • Demo2: Controlling Program Flow5:19

    Learn to control T-SQL programs with if and else statements and a while loop, using begin blocks, declared variables, and break or continue to manage iteration and avoid infinite loops.

  • Implementing T-SQL Error Handling. Part 16:14

    Raise errors and use throw in T-SQL to signal issues, capture error details, and set up alerts for critical conditions. Distinguish system and custom errors; custom numbers start at 50,000,001.

  • Implementing T-SQL Error Handling. Part 25:43

    Master t-sql error handling by capturing the system error number immediately, raising and throwing errors, logging custom errors with sp_add_message, using with log, and setting up alerts for high-severity events.

  • Demo: Implementing T-SQL Error Handling10:53

    Learn robust T-SQL error handling by raising custom errors with raise error, capturing details via the error system variable, and defining reusable messages with ESP_add_message.

  • Implementing Structured Exception Handling10:26

    Learn structured exception handling in T-SQL with try catch blocks to encapsulate error prone code, log error_number, error_message, error_severity, error_state, and error_line, and use throw for rethrows.

  • Demo: Implementing Structured Exception Handling7:21

    Explore structured exception handling in T-SQL with try catch blocks to isolate error prone code, handle errors gracefully, and retrieve error information like error number and message.

  • Transactions and the Database Engine8:53

    Explore how transactions extend batches to ensure all operations succeed or fail as a unit, preserving acid properties. Learn autocommit and explicit transactions with begin, commit, rollback, and try/catch.

  • Demo 1: Transactions and the Database Engine8:58

    Explore how transactions enforce atomicity and maintain data integrity in a multi-statement batch, using try catch for error handling with two simple tables: orders and order details.

  • Demo 2: Transactions and the Database Engine9:20

    Demonstrates executing a multi-statement batch inside a try-catch block, where some inserts succeed and others fail. Illustrates that transactions ensure operations succeed or fail together, preventing partial commits and inconsistencies.

  • Controlling Transactions8:27

    Master how to control transactions in t-sql using begin transaction, commit transaction, rollback transaction, and exact abort to ensure atomic, consistent database changes.

  • Demo: Controlling Transactions8:44

    Master explicit transaction control in T-SQL using begin transaction, try-catch, and commit or rollback to guarantee atomicity, consistency, isolation, and durability for multi-statement operations, and report error details.

  • Factors in Query Performance. Part 18:41

    Improve server query performance by writing selective queries, using clustered and non-clustered indexes, avoiding selecting all columns, and favoring set-based operations over cursors, while maintaining distribution statistics up to date.

  • Factors in Query Performance. Part 28:35

    Explore non-clustered indexes, their impact on query performance, and when to use or avoid them, including distribution statistics, execution plans, and the superiority of set-based methods over cursors.

  • Demo 1: Factors in Query Performance6:54

    Explore cursors versus set-based operations in SQL Server by calculating the maximum order date per employee with a cursor, then compare it to a more efficient set-based solution.

  • Demo 2: Factors in Query Performance6:54

    Compare cursors and set-based operations to optimize T-SQL queries for performance. The demo shows calculating max order date per employee with a cursor and contrasts it with a set-based solution.

  • Demo 3: Factors in Query Performance6:15

    Demonstrates using set-based queries to compute the maximum order date per employee and compares with cursors, highlighting faster, scalable performance in SQL Server.

  • Displaying Query Performance Data8:01

    Learn how SQL Server uses execution plans to analyze query performance, compare estimated and actual plans, view graphical plans in SSMS, and identify bottlenecks to inform indexing and tuning.

  • Demo: Displaying Query Performance Data9:50

    Explore how SQL Server execution plans and query performance data reveal how queries run and where to optimize with estimated and actual plans, statistics time, and statistics IO.

  • Querying System Catalog Views and Functions8:12

    Learn to query system catalog views in the sys schema and use information schema views for standard metadata, plus system metadata functions to retrieve object_id and server_property values.

  • Demo 1: Querying System Catalog Views and Functions8:40

    Explore SQL Server metadata by querying system views, information schema views, and system metadata functions to inspect server settings, database properties, and user tables, and resolve schema IDs with schema_name.

  • Demo 2: Querying System Catalog Views and Functions9:19

    Query system catalog views and functions to access SQL Server metadata, including data types and columns, information schema views for standardized queries, and server property function outputs.

  • Executing System Stored Procedures8:56

    Learn how to execute system stored procedures in SQL Server using exec or shortcut, pass parameters by name, and retrieve metadata with system procedures like sys.databases, system tables, and sp_columns.

  • Demo: Executing System Stored Procedures9:15

    Learn to execute system stored procedures in SQL Server to retrieve metadata, manage databases, and filter results by schema or parameters, using exec and parameterized calls.

  • Querying Dynamic Management Objects7:59

    Explore dynamic management objects in SQL Server to retrieve real-time metadata and state information. Learn how DMOs are categorized and queried as views and table-valued functions for monitoring and troubleshooting.

  • Demo 1: Querying Dynamic Management Objects6:49

    Discover how to query dynamic management objects, including DMVs and DMFs, to monitor SQL Server performance, browse system objects, and inspect active user connections with Sysadm Exec Sessions.

  • Demo 2: Querying Dynamic Management Objects6:26

    Explore querying dynamic management objects to monitor active user sessions, group by login name, and identify dependencies using referencing entities, enabling performance monitoring and change-safe administration.

Requirements

  • No prior SQL or database experience required - this course starts from absolute basics and guides you step-by-step through every concept.
  • Basic computer skills and familiarity with Windows environment is helpful but not essential - everything is explained clearly for complete beginners.

Description

Complete T-SQL Mastery Course Description

Master Microsoft SQL Server with the most comprehensive T-SQL training available online!

Transform yourself from a complete beginner to a confident T-SQL professional with this extensive 146-lecture course designed to take you through every aspect of Microsoft SQL Server database development and querying.

What You'll Learn

Foundation & Setup: Start with complete SQL Server installation, sample database setup, and T-SQL fundamentals including syntax, expressions, and basic concepts that form the backbone of database programming.

Query Mastery: Master SELECT statements, column aliases, CASE expressions, and advanced filtering techniques using predicates, TOP, and OFFSET-FETCH clauses to retrieve exactly the data you need.

Advanced Joins & Relationships: Become proficient with all join types including INNER, OUTER, CROSS, and SELF joins, understanding how to work with multiple tables and create complex data relationships.

Functions & Data Types: Work confidently with built-in functions, conversion functions, logical functions, NULL handling, and aggregate functions while mastering SQL Server's comprehensive data type system.

Subqueries & Advanced Techniques: Write powerful self-contained and correlated subqueries, use EXISTS predicates, and implement sophisticated querying strategies for complex business requirements.

Database Objects: Create and utilize views, inline table-valued functions (TVFs), derived tables, and Common Table Expressions (CTEs) to build reusable and maintainable database solutions.

Set Operations & Window Functions: Master UNION, EXCEPT, INTERSECT operations, and leverage the power of window functions with OVER clauses for advanced analytical queries.

Stored Procedures & Programming: Develop robust stored procedures with parameter passing, dynamic SQL generation, and complete T-SQL programming including variables, control flow, and error handling.

Performance & Optimization: Understand query performance factors, analyze execution plans, and implement best practices for optimal database performance.

System Administration: Query system catalog views, execute system stored procedures, and work with dynamic management objects for database monitoring and administration.

Why This Course?

With over 140 hands-on demonstrations and real-world examples, you'll gain practical experience that directly applies to professional database development. Each concept is reinforced with multiple demo sessions, ensuring you understand not just the theory but can implement solutions confidently.

Whether you're starting your database career, transitioning from other database systems, or looking to deepen your SQL Server expertise, this course provides the comprehensive foundation you need to succeed in today's data-driven world.

Enroll now and join thousands of students who have transformed their careers with T-SQL mastery!

Who this course is for:

  • IT professionals, software developers, and system administrators who need to add T-SQL and SQL Server skills to advance their careers and job prospects.
  • Data analysts, business analysts, and reporting professionals who want to query databases directly instead of relying on others for data extraction.
  • IT professionals who want to start a career in database development, data analysis, or business intelligence with no prior SQL experience required.
  • Students and career changers looking to break into the lucrative database field with comprehensive, hands-on training that employers actually value.