I've worked with mysql for some time but have never had to do anything anywhere near complicated. I'm working on a new project and need a little push in the right direction. Lets say I want to have a table that stores cats. Lets say I want to store the cats name, and food that the cat likes. Then lets say I want to query all cats that like fish, milk, and mice. I don't want to have the 'cats' table have rows for 'fish' 'milk' 'mice' that can be yes or no or 1 or 0. I think want I'm looking for is having a separate 'foods' table and then use the join statement. But I have no clue where to start looking or what to search for. Another way to think about this would be if you had a blog, and wanted posts to have categories. How would I store which posts are in which categories, and how would I query for posts by category?
I realize this is probably a very basic question, and would be happy with even a link to a tutorial explaining the structure / commands needed to pull this off! Thanks a lot!
catandfood, which is implemented by means of a junction table, such as thecat_foodtable in simshaun's answer.