<p>In the following table structure:</p>

<pre><code>Fruits 
(
    fruit_id,
    fruitName
)


Vegetables
(
    vegetable_id,
    vegetableName
)

favoriteFoods 
(
     food_id,
     foodName,
     type_id (References either a fruit or a vegetable)
)
</code></pre>

<p>I realize that I could forgo using a foreign key constraint on the favoriteFoods table and then simply add a type field to the favoriteFoods table to differentiate between fruits and vegetables.  But how would you structure the tables so that you could actually create the necessary foreign key constraints? </p>

I would only use 2 tables instead.  Instead of having a separate Fruits and Vegetables table, why not have a table of Foods.  Then have a foreign key constraint on fkfood_id to food_id.  Then if for some reason you ever have to add meat, it would be much easier to maintain the application that uses this.
```
```
Food
    (
    food_id,
    foodName,
    foodType
    )

favoriteFoods
    (
    favoritefood_id,
    fkfood_id
    )
```
```