Skip to content
Exercise · Selecting and sorting · lesson 9 of 10

Exercise: the three highest prices

Write a query to the menu_items table that returns the three highest distinct prices on the menu: one column, price, from the highest price to the lowest.

  • Right now these are 320.00, 310.00 and 290.00.
  • If Raf also costs 320.00, the answer stays the same: each price appears in the result once.

Constraints: equal prices count as one price. If the menu has fewer than three distinct prices, the query returns all there are.

top_prices.sql — sql
sql · 3 lines
Ctrl+Enter run · Esc leave editor