Persistent Systems interview question

basic sql question, queries, joins