Riskified interview question

write sql query based on kpis defined by diagram