# Уровень 9.1 задачника SQL

Даны таблицы:

authors
id | name
--- | ---
1 | Alan
2 | James
3 | John
4 | Kella
5 | Max
6 | Kevin
7 | Taylor
8 | Bryan
9 | Jorge
10 | Emile

posts
id | title | author_id | date
--- | --- | --- | ---
1 | Lorem ipsum dolor | 10 | 2023-11-25
2 | Lorem ipsum dolor sit amet | 4 | 2023-10-24
3 | Integer in quam | 7 | 2023-09-21
4 | Aliquam erat volutpat | 6 | 2023-11-11
5 | Ut tristique volutpat urna | 9 | 2023-08-31
6 | Nullam imperdiet | 3 | 2023-11-25
7 | Donec non tincidunt orci | 8 | 2023-11-20
8 | Pellentesque habitant | 2 | 2023-07-03
9 | Sed non massa | 1 | 2023-11-25
10 | Sed fermentum | 5 | 2023-10-19
11 | Sed fermentum quis massa | 9 | 2023-11-09
12 | Etiam id magna ullamcorper | 10 | 2023-02-28
13 | Aenean metus urna, imperdiet | 1 | 2023-06-30
14 | Nulla tincidunt arcu erat | 2 | 2023-07-25
15 | Sed augue urna | 8 | 2023-10-01
16 | Vivamus laoreet | 7 | 2023-07-06
17 | Maecenas ac metus | 6 | 2023-11-25
18 | Maecenas ac metus sed augue | 4 | 2023-11-25
19 | Donec mi massa, venenatis | 3 | 2023-11-25
20 | Nunc ac venenatis orci | 5 | 2023-11-25

ratings
id | post_id | rating_value
--- | --- | ---
1 | 15 | 4.7
2 | 6 | 4.8
3 | 8 | 4.9
4 | 7 | 5.6
5 | 9 | 8.8
6 | 12 | 9.3
7 | 11 | 9.1
8 | 13 | 3.9
9 | 14 | 6.9
10 | 16 | 6.6
11 | 17 | 7.9
12 | 4 | 8.5
13 | 3 | 7.5
14 | 2 | 9.0
15 | 18 | 8.4
16 | 1 | 5.6
17 | 19 | 3.3
18 | 5 | 6.6
19 | 20 | 9.1
20 | 10 | 8.5

Решите для них следующие задачи:

Найдите топ-5 авторов с наивысшим средним рейтингом по их постам.

← →
↑