There are 2 tables
table1 table2
book_id | tag_id tag_id
---------------- -----------
5 | 1 1
5 | 3 3
5 | 4 4
7 | 1
7 | 2
7 | 4
I need to create sql query for selection all book_id where tag_id is multitude of all tag_id from table2 (SQLite).
For example, book_id = 5 is acceptable because it has all tags from table2 (1, 3, 4).
The book with book_id = 7 isn’t acceptable because it has only 1 and 4 tags, but hasn’t tag_id = 3.
I’m not sure if this query will be very efficient, but…
Setup code: