MYSQL - How to make a table with a column that will sum columns from parent tables?
What you're asking to do is a type of denormalisation: You're adding redundant data to a single table in order to avoid having to query multiple tables to get the same information. This is done to increase performance of SELECT queries and/or simplify such queries.  

Since the price columns are in different tables / rows, you unfortunately can't use generated columns.

So you're going to have to consider other options:


You could use a VIEW on top of the FOODS table which summed the prices from the two parent tables. So whenever you wanted to SELECT from the FOODS table (and you wanted to include sum_price), you instead SELECTed from this VIEW. Something like:

CREATE VIEW V_FOODS([the columns of FOODS], sum_price) AS 
  SELECT [the columns of FOODS], FLAVOR.price + SIZE.price AS "sum_price"
  FROM FOODS
    INNER JOIN FLAVOR USING(IDflavor)
    INNER JOIN SIZE USING (IDsize);

(As pointed out by RDFozz, note that this isn't actually denormalisation of the data, since the actual data stay in the parent tables.)
You could use TRIGGERs to populate a sum_price column in FOODS. You would need a trigger on UPDATEs to each of FLAVOR and SIZE, and a trigger on INSERTs to FOODS.
You could have a sum_price column in FOODS and give your application the responsibility of keeping it up-to-date.
You could also give up and not denormalise. Just let your application join FOODS, FLAVOR and SIZE whenever you need the sum of prices.