Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Further Sorting the Catalogue | Sorting Data
Introduction to SQL
セクション 3.  4
single

single

bookChallenge: Further Sorting the Catalogue

メニューを表示するにはスワイプしてください

In the last task, you were helping a customer look through books.

Following was the query we came up with:

SELECT title, author, publication_year, genre 
FROM books 
ORDER BY publication_year;

Since there are too many books in the library catalogue, it is hard for the customer to find a relevant book even after sorting by publication_year, since many books can have the same publication year.

You can further sort the books to make the results much easier to look through. For example, you can sort them by Genre, and then by the Title.

In places where multiple books have the same Publication Year, the query will sort the rows by Genre, and in case some of those rows have the same Genre, they'll be further sorted by the Title.

タスク

スワイプしてコーディングを開始

Your task is to modify the query such that the fetches books are sorted according to the following columns (in the given order):

  • publication_year in descending order;
  • genre in ascending order;
  • title in ascending order.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 3.  4
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt