Norfolk Southern Interview Question

Answer a relatively complex sql query