Xoriant interview question

Some DBMS queries.