Tredence Interview Question

SQL queries and few probability questions