Fleshed out select case for DB operations