Insurify interview question

Some logic, probability and sql questions