Thanks, this was a useful excercise. I didn't get 6, 13 and 15 right according to your answers.
6: I've never used ##globals. I know in procedural languages globals are frowned upon and I suspect the same applies in any language. I think I may have learned about them a long time ago but forgotten so thanks for the reminder.
13: I've learned something new here. I knew that complex joins were tricky and it depended on what type of join you do. I was confused by a recent QOTD about doing similar things in the ON clause of a MERGE statement and I think in both situations I would avoid doing any type of "theta" join (just learned what they are called too, thanks).
15: I knew that coalesce returned it's result in the datatype with the highest precedence. I looked at 'false' and 'true' and figured they wouldn't be able to be implicitly converted to the int of highest precedence and so it would error, but I suppose that's because they are never evaluated. What if those were int columns rather than hardcoded integers, and they were NULL on a particular row? Then the statement would fail. A static select with hardcoded values is artificial.
For example, something like this is a more realistic simulation of how coalesce is used, and it will fail:
Declare @IntTest Int
SELECT COALESCE(NULL, @IntTest, 'TRUE', 'FALSE')
I've also tried the equivalent Q15 query on Oracle and it fails too:
SELECT COALESCE(NULL, 1, 2, 3, 'TRUE', 'FALSE') from dual
Makes me wonder who is implementing COALESCE the ANSI way!