Commerzbank interview question

They asked to solve an example with SQL and to make a test for process.