Custom functions used in Google Sheets for ease of use and improved functionality.
SELECT
id, title,
(
select count(*) from booksales where books.id = booksales.book_id
) as 'Sold'
FROM books
WHERE
(
select count(*) from booksales where books.id = booksales.book_id
) > 1