Inference Problems in Database Systems