Rating:

For this question you need to look at the orderdetails table to get the subtotal and quantity of purchases to determine the revenue of a given order. You also need to link this to a specific game, group by games of the same ID, and make sure you're only looking at action games via genres table. Make sure to submit the 5th one.

SELECT SUM(od.quantity \* od.subtotal) AS total_revenue
FROM Orders o
INNER JOIN OrderDetails od ON o.order_id = od.order_id
INNER JOIN Games g ON od.game_id = g.game_id
INNER JOIN Genres gn ON g.genre_id = gn.genre_id
WHERE gn.genre_name = 'Action'
AND YEAR(o.order_date) = 2023
GROUP BY g.game_id
ORDER BY total_revenue DESC
LIMIT 5;

flag is texsaw{247.16}