A very interesting puzzle, where you see the data type conversion in action. I have previously blogged about this puzzle and had received amazing feedback.
SQL Puzzle – Solution to Strange Results – IN and IS NOT NULL –
Earlier I had published a blog post about a puzzle SQL Puzzle – IN and IS NOT NULL – Strange Results. Today we will see a solution to strange results puzzle.
SQL Puzzle – IN and IS NOT NULL – Strange Results
Today, let us see a very simple puzzle where we are getting strange results when using NOT IN and IS NULL in a T-SQL query.
SQL Puzzle – Schema and Table Creation – Answer Without Running Code
This Table Creation puzzle asks for an explanation before you run its code. I suggest examining the batch separators carefully.
Delete the Wrong Row: A Cheap Answer That Passes the Test
A cheap answer to the multiple table delete puzzle reads only 6 pages and passes the check. It can still delete the wrong row. This post shows the answer, asks you to find the row it removes by mistake, and fixes it with a delete that costs 5 reads.
Fewest Logical Reads: The Answer to the Delete Qualified Rows Puzzle
The fewest logical reads for the multiple table delete puzzle come from reading each table as few times as the rules allow. A string of student IDs gets to 4 reads. A set based delete needs 5 and is the one to use. The starting script needed 19.
SQL Agent Job Backslash Puzzle: Why Both Rows Were Deleted
A SQL Agent job backslash at the end of a comment line can turn a one row delete into a delete of the whole table. This puzzle sets up the job, explains the cause and tests the effect in T-SQL. It ends with a safe way to write the step.






