This looks like homework so I will not give you a complete solution. Furthermore I will assume you are on SQL server.
1) Create a
stored procedure[
^], easy.
2) Use
UNION ALL[
^] to concatenate two outputs of the same structure.
Hint: How do you subtract qauntities in tbl3?
3) Use
SUM[
^] aggregate function to add the quantities.
Hint: What do you need to put in
GROUP BY[
^] clause?
4) Insert the results into a temporary table using
SELECT INTO[
^]. Temporary table name starts with a hash symbol (#).
Hint: How do you make the table visible outside your stored procedure?
Cheers