#289 Finding Authors with a Single Book Genre

Companies:
Aston
Themes:
SQLJoinsAggregationPractice

The following tables are given:

Table genre

genre_id | name_genre
---------|-------------
1        | Novel
2        | Poetry
3        | Adventure

Table author

author_id | name_author
----------|------------------
1         | Bulgakov M.A.
2         | Dostoevsky F.M.
3         | Yesenin S.A.
4         | Pasternak B.L.
5         | Lermontov M.Yu.

Table book

book_id | title                  | author_id | genre_id | price  | amount
--------|------------------------|-----------|----------|--------|--------
1       | The Master and Margarita | 1       | 1        | 670.99 | 3
2       | The White Guard        | 1         | 2        | 540.50 | 5
3       | The Idiot              | 2         | 1        | 460.00 | 10
4       | The Brothers Karamazov | 2         | 1        | 799.01 | 3
5       | The Gambler            | 2         | 1        | 480.50 | 10
6       | Poems                  | 3         | 2        | 650.00 | 15
7       | The Black Man          | 3         | 2        | 570.20 | 6
8       | Lyrics                 | 4         | 2        | 518.99 | 2

Display in alphabetical order all authors who write in only one genre.

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in