Adding database query script