Copeland Interview Question

How to get the following output using SQL commands