Advanced Querying Techniques in SQL Server

https://www.pluralsight.com/courses/advanced-querying-techniques-sql-server 

by Gerald Britton

Mod 1: Course Overview

  1. Course Overview

Mod 2: Navigating Data Hierarchies Using Recursive Queries

  1. Introduction to Recursive Queries
  2. Using the WITH Statement
  3. Demo: Iterative Queries Using the WITH Statement
  4. Writing Recursive Transact-SQL
  5. Demo: Simple Recursive Queries
    • you can use the MAXRECURSION clause to safeguard against an infinite loop cause by a recursive query
    • how to generate Fibonacci series using recursive t-sql
  6. T-SQL Restrictions for Recursive Queries
    • Cannot be used with recursive queries
      • SELECT DISTINCT
      • GROUP BY, HAVING
      • Scalar aggregation (SUM, AVG, MIN, MAX etc.)
      • PIVOT (SQL Server 2012 or later)
      • TOP
      • LEFT, RIGHT, OUTER JOIN (INNER JOIN is allowed)
      • Subqueries
  7. Demo: Navigating a Data Hierarchy Using Recursion in T-SQL
  8. Module Summary
    • SQL Server maximum recursion (32,767)

Mod 3: Aggregating Data Using the PIVOT and UNPIVOT Clauses
  1. Introduction to PIVOT and UNPIVOT
  2. Demo: Pivoting in a Spreadsheet
  3. Demo: Pivoting in Transact-SQL Using Cross-tabulation
  4. Understanding PIVOT Syntax
  5. Demo: Using PIVOT in Transact-SQL
  6. Demo: Pivoting on Multiple Columns
  7. Demo: Building a Dynamic PIVOT Query
  8. Understanding UNPIVOT Syntax
  9. Demo: Using UNPIVOT and CROSS APPLY
  10. Module Summary
Mod 4: Storing Data as Entities, Attributes, and Values (EAV)
  1. Introduction to the EAV Model
  2. Demo: Handling Sparse Data Using a Traditional Approach
    • sql server allows 1024 columns per table
  3. Demo: Refactoring into an EAV Model
    • demo of an unstructured sql table, an EAV. you can basically have a schema-less design in sql server, with unlimited columns. however, you sacrifice referential integrity and writing queries become very difficult  stackoverflow
  4. Demo: Factoring out Attributes Using Foreign Keys
  5. Recapping Progress and Issues
  6. Demo: Handling Types and Constraints
  7. Demo: Implementing Dynamic Constraints
  8. Demo: Exploring Sparse Columns
    • you can mark a column SPARSE
      • occupies no space when value is null or 0
  9. Demo: Using XML as an Alternative
    • demo of the XML data type in sql server
  10. Demo: From XML to JSON
    • sql server 2016 introduced JSON support (not as a data type)
      • you can use JSON_VALUE to query a value
  11. Module Summary
Mod 5: Sampling Data in SQL Server
  1. Introducing Data Sampling
  2. Understanding Data Sampling Terminology
  3. The Syntax of the TABLESAMPLE Option
  4. Demo: Using the TABLESAMPLE Option
  5. Demo: Stratified Sampling
  6. Demo: Cluster Sampling
  7. Module Summary


Comments

Popular posts from this blog

Angular Routing and Navigation Playbook

Working with Files in C# 10

Mastering Git