Insurify Interview Question

Some logic, probability and sql questions