I am curious if there is a command I'm unaware of in MySQL to perform a task that seems not too hard. Here are simplified versions of two tables I have.
Groups
name
Apples
Bananas
Oranges
Trees
Group Keywords
group name | keyword name
Apples Yummy
Apples Round
Bananas Yummy
Oranges Yummy
Oranges Round
Trees Tall
The goal is to have a query that will get related groups via the keywords. So if I am looking at Apples, it will be related to Bananas and Oranges because all of them link to at least Yummy. Oranges will come first because it matches both keywords, where Bananas only match one. Then Trees do not show at all.
PS: in reality I use the primary key IDs, but using just names made it easier.