Updated database queries