IBM interview question

sql question writing a method based on table