Coding task · SQL and MySQL course · Module 10: Transactions and advanced SQL

Numbering books by price

The Keeper wants to number the books from cheapest to most expensive. Use the ROW_NUMBER() window function.

Task

Write a query that retrieves tytul and cena from the ksiazki table, and additionally adds a column aliased as numer containing the result of ROW_NUMBER() OVER (ORDER BY cena). Use the word AS to name the numer column.