IBM Interview Question

Standard Coding Algorithm Question followed by SQL