1393. Capital Gain/Loss ¶ SQL 1 2 3 4 5SELECT stock_name, SUM(IF(operation = 'Buy', -price, price)) AS capital_gain_loss FROM Stocks GROUP BY 1;