FedEx Interview Question

Asked to solve SQL questions live. I was able to solve it