New SQL PuzzleJune 13th, 2012 — ddelmoli
Sorry for the drought — to keep everyone’s mind fresh, how about a little puzzle?
Use SQL to create a symmetric Pascal matrix, with the output being (i,j,v). So that a Pascal matrix of size 4 would end up as:
Try to stay with ANSI SQL 2008 if possible — bailing out to other languages and functions is discouraged
Efficiency is an interesting idea here, as it’s pretty easy to do this by brute force calculations of factorials for every entry — but where’s the fun in that?
Extra credit for solutions which can take in the matrix size as some sort of parameter.