Sensibill Interview Question

How would you get the answer to these questions using SQL?