SQL has always been my weakest point as a developer. So in times like this, I usually resort to application-level solutions. This is the magic of doing pet-projects, you get to work on your weak points. PROBLEM: The COUNT(*) function was return 1 on zero...