Testing the db queries