Persistent Systems Interview Question

basic sql question, queries, joins