Second-Highest Order Total

easy
Unit 4 · Subqueries & Dates0/3 to milestone

A classic interview question: return a single row with one column, second_highest, holding the second-highest distinct order total.

If the highest total appears several times, it still counts once. If there's no second-highest value, return NULL.

Schema

customers(id, name, country, signup_date)
orders(id, customer_id, order_date, total)
#subqueries#interview1 visible + 3 hidden tests
query.sql · SQLite
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Second-Highest Order Total · TechGradify