mysql select from book --------- ----------- ------------------- -----

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
mysql> select * from book;
+---------+-----------+-------------------+-------+
| BOOK_ID | AUTHOR_ID | NAME | TYPE |
+---------+-----------+-------------------+-------+
| 1 | 1 | Kobzar | poem |
| 2 | 1 | Roman N1 | roman |
| 3 | 2 | Toreodore | roman |
| 4 | 1 | The Roman N155678 | roman |
+---------+-----------+-------------------+-------+
4 rows in set (0.00 sec)
mysql> select TYPE, count(distinct AUTHOR_ID) from book group by TYPE;
+-------+---------------------------+
| TYPE | count(distinct AUTHOR_ID) |
+-------+---------------------------+
| poem | 1 |
| roman | 2 |
+-------+---------------------------+
2 rows in set (0.00 sec)