Added database operations for querys