working sql bucket