Add a comment here that people with no badges are expected to be Null ranked and that the following query creates that situation.  I had to test my SQL to see that that was what this code did (didn't realize this might be important until I read the unittests).