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

Exercise: coffee prices after a rise

The chain raises coffee prices by 30 rubles. Write a query to the menu_items table that returns every item in the coffee category with its price after the rise: the columns name and new_price. The priciest come first, and items with the same price go by name in alphabetical order.

  • Pumpkin latte comes first, with the new price 350.00.
  • Cappuccino and Latte cost 250.00 each, and Cappuccino comes first.

Constraints: only coffee is in the result, even when another item costs more. If the menu has no coffee, the query returns zero rows. The table itself doesn't change: the new price exists only in the result.

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