database insertion and selection operation