There are tables:
books -id -title -pubDate
authors -id -name
publish -id -name
book_author -book_id -author_id
book_publish -book_id -publish_id
You must select a list of the most productive (number of books per year), authors for each publisher. Help me please! 3rd day I can not think of.
UPD1:
This is what I was able to give birth to:
SELECT a.firstName, a.middleName,a.lastName, b.title, p.name, COUNT(b.id) as cnt FROM authors as a, books as b, author_book as ab, publishing as p WHERE p.id = 3 AND ab.book_id = b.id AND b.pubDate > '2015-01-01 00:00:00' GROUP BY b.id HAVING cnt > 5
UPD2:
Work Request:
SELECT a.firstName, p.name, COUNT(ab.author_id) AS total FROM books AS b JOIN publish_book AS pb ON pb.book = b.uid JOIN author_book AS ab ON b.uid = ab.book_id JOIN authors AS a ON ab.author_id = a.uid JOIN publishing as p ON p.uid = pb.publish WHERE p.id = 4 AND YEAR(b.pubDate) = 2016 GROUP BY ab.author_id ORDER BY total DESC LIMIT 10