Frage im Vorstellungsgespräch bei DAT Solutions

How would you write a SQL query to get this output seen here?