IBM Interview Question

sql question writing a method based on table