Select year and sum of games_sold, aliased as total_games_sold; order results by total_games_sold descending -- Filter game_sales based on whether each year is in the list returned in the previous task -- Add a column showing total games_sold in each year to the table you created in the previous task.
时间: 2024-02-18 19:02:07 浏览: 51
Sales-Analysis-Project:简短练习以显示一年的销售数据
Sure, I understand your question. However, it seems like you are asking for a SQL query and I am an AI language model, I don't have access to any database. But I can help you with the query itself, so here's the query you can use to achieve the desired results:
```
SELECT year, SUM(games_sold) AS total_games_sold
FROM game_sales
WHERE year IN (SELECT year FROM game_sales GROUP BY year ORDER BY SUM(games_sold) DESC)
GROUP BY year
ORDER BY total_games_sold DESC;
```
This query will first select the year and the sum of games sold for each year, aliasing the sum as 'total_games_sold'. It then filters the results based on whether each year is in the list returned in the previous task. Finally, it adds a column showing the total games sold in each year and orders the results by total games sold in descending order.
阅读全文