A Saturday fun puzzle with DATETIME2 and CAST in SQL Server 2012. Run each script one at a time, guess the output, and learn something new.
SQL SERVER – Quiz and Video – Introduction to Hierarchical Query using a Recursive CTE
Learn to write a hierarchical query using a recursive CTE with a short video and a quiz on an employee and manager table. Check your answer.
SQL SERVER – A Tricky Question and Even Trickier Answer – Index Intersection – Partition Function
Can one table, used once, give 2 join operators in an execution plan? Readers used ranking functions, and my own answer relies on index intersection.
SQL SERVER – A Puzzle – Illusion – Confusion – April Fools’ Day
A light puzzle for April Fools’ Day: two division queries that look the same in SSMS. Will they return the same result, and why?
SQL SERVER – Solution Part 2 – A Quick Puzzle on SQL JOIN and NULL – SQL Brain Teaser
Part 2 of the solution to my puzzle on SQL Join and NULL. Readers still email me answers every day, so here are more of the good ones they sent.
SQL SERVER – Solution – A Quick Puzzle on JOIN and NULL – SQL Brain Teaser
The solution to my quick puzzle on JOIN and NULL. Many readers said the puzzle had an error; it did not, and here is the answer that works.
SQL SERVER – A Quick Puzzle on JOIN and NULL – SQL Brain Teaser
A relaxing SQL Brain Teaser on INNER JOIN and NULL: set up a sample table, look at the result, and fill in the missing T-SQL that produces it.






