Clean Solution
\nSELECT stock_name, (SUM(CASE WHEN operation = \'Sell\' THEN price\n                             ELSE -price\n                              END\n              
```\nSELECT stock_name, (SUM(CASE WHEN operation = \'Sell\' THEN price\n                             ELSE -price\n                              END\n                         )) as capital_gain_loss\n  FROM Stocks\n GROUP BY stock_name\n```
['MySQL', 'Oracle']