I am trying to set up a normalised MySQL database containing the three following tables. The first table contains a list of items which can be described by various tags. T
You could try something like this:
select item, count(*) 'NrMatches'
from #table1 i
inner join #table2 l ON i.id = l.item_id
inner join #table3 t on l.tag_id = t.id
where t.tag IN ('cheap', 'pet', 'dog')
group by item
having count(*) = (select count(*) from #table3
where tag IN ('cheap', 'pet', 'dog'))
It means having your search terms twice, but it mostly does what you're after.