There is a table
books id name date_created 1 book1 1469527903 2 book2 1469527903 3 book3 1469527903
There is a table
sold_books book_id book_price 1 10 1 20 2 30 2 21
Here is the task: Deduce the number of books, if only the book_id in sold_books matches the book.id, and book.date_created = '1469527903'; In general, it should work: 2 Since the books with ID: 1, 2 are sold.
I try such a request
SELECT count(books.id) count_sold_books FROM `books` as books INNER JOIN `sold_books` ON books.id = sold_books.book_id;
And I write 4 entries, then e of sold_books.
Tried both LEFT JOIN and RIGHT JOIN ...