Compute new records based on existing ones (e.g., sum of 2 records)?
I don't like the design, but sometimes we just have to deal with the what we find even if we don't like it.  Here is a query that gets you the 'Variation' part you are looking for:

select fruit, 'Variation' as recordtype, act_qty-exp_qty as qty from
   (select fruit, qty as exp_qty from foobar where recordtype ='Expected') as ex 
join 
   (select fruit,qty as act_qty from foobar where recordtype='Actual') as ac 
using (fruit);


You can either insert those results into the table (after clearing out the old results) or you can create a view with UNION ALL so that the Variation rows appear in the view, without ever physically existing.