What best practices do you use for testing database queries?
I'm currently in the process of testing our solution that has the whole "gamut" of layers: UI, Middle, and the omnipresent Database. Before my arrival on my current team, query testing was done by the testers manually crafting queries that would theoretically return a result set that the stored procedure should return based on various relevancy rules, sorting, what have you. This had the side effect of bugs being filed against the tester's query more often than against the actual query in question. I proposed actually working with a known result set that you could just infer how it should