clunky sql requests