Newgen Software interview question

Oops dbms sql sorting trees