Truecaller interview question

It was the sql query , a easy one .