Question · SQL and MySQL course · Module 2: Querying data (SELECT)

Sorting by two columns

How will ORDER BY rok_wydania DESC, tytul ASC behave?

Answer options

  • It sorts only by title, ignoring the year
  • It first sorts descending by year, and for the same year - ascending by title
  • It sorts ascending by year and title at the same time
  • It returns an error - you cannot give two columns
Show the answer

Correct answer:

  • It first sorts descending by year, and for the same year - ascending by title