cermati Interview Question

My approach to solve a use case using SQL