✅ 100% EASY || FAST 🔥|| CLEAN SOLUTION 🌟
IF THIS WILL BE HELPFUL TO YOU, PLEASE UPVOTE!\n# Code\n\n/* Write your PL/SQL query statement below */\nSELECT stock_name,(SUM(CASE WHEN operation = \'Buy\' \n
IF THIS WILL BE HELPFUL TO YOU, PLEASE UPVOTE!\n# Code\n```\n/* Write your PL/SQL query statement below */\nSELECT stock_name,(SUM(CASE WHEN operation = \'Buy\' \n\nTHEN -price ELSE price END)) AS capital_gain_loss FROM Stocks \n\nGROUP BY stock_name\n\n\n```\n![5kej8w.jpg](https://assets.leetcode.com/users/images/6981c766-91c0-40f6-972a-475abbb94bab_1690822758.3963957.jpeg)\n
['Database', 'Oracle']