i have tried this several ways and it wont’ workschema book: book_id,
Question
i have tried this several ways and it wont’ workschema book: book_id,
book_name, author_id.
Author: author_id, first_name, last_name. DOB, social.
i am trying to make a query that lists the first and last name of each author and counts how many books they wrote if they wrote more than one. but i am having issue . this is what i have so far,
select a.first_name, book_name, count(book_name) as “number of books” from author a join bookb on (b.author_id = a.author_id) group by book_name name having count (*) >1; i have also tried it using
select a.first_name, count(book_name) as “number of books” from author a join book b on a.author_id + b.author_id
group by b.author_id having count (book_name) >1; the only way i get any kind of data is using this query but it gives me nothing for results and there are a few authors that wrote more than one book
sleect book_name, count(b.book_name) as “number of books”
from book b join author a
on (b.author_id = a.author_id) group by b.book_name having count (book_id ) >1 tried with author_id too? i am confused i need some explanation please