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
course content

Зміст курсу

Introduction to SQL

Introduction to SQL

1. Getting Started
3. Sorting Data
4. Populating a Database
5. Updating & Deleting Data

book
Challenge: Further Sorting the Catalogue

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

Following was the query we came up with:

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.

Завдання
test

Swipe to show code editor

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
toggle bottom row

book
Challenge: Further Sorting the Catalogue

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

Following was the query we came up with:

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.

Завдання
test

Swipe to show code editor

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
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt