Ferry ledger

Three cheapest crossings

Find the three lowest fares in sailings. Return sailing_id, landing, and fare in that column order. Put the cheapest first. When fares tie, put the lower sailing ID first.

Query result

Run the starter query and compare its row count with the task.

Hint

ORDER BY sets the order before LIMIT takes rows. What number should replace the starter’s 1? With tied fares, add a second sorting column after a comma.

One solution
SELECT sailing_id, landing, fare
FROM sailings
ORDER BY fare ASC, sailing_id ASC
LIMIT 3;