-- find all book ids coauthored by Smith and Jones: -- (let's assume that the author_name is unique) select book_id, count(*) from authors where author_name = 'Smith' or author_name = 'Jones' group by book_id having count(*) = 2 #### -- find all book ids coauthored by Smith and Jones: -- (let's assume that the author_name is unique) select book_id, count(*) from authors where author_name in ('Smith', 'Jones') group by book_id having count(*) = 2