Siemens Interview Question

Asked to write an SQL query.