Let's analyze the sales of Console Games. We are tasked to extract insights from the company. The dataset we will be using is the Console Games Dataset . I have imported the data into my MS SQL Server (Transact SQL). Table Design: Challenge #1: What are the total sales of video games in North America, Europe, and Japan. SELECT SUM(na_sales) AS TOTAL_NA_SALES, SUM(eu_sales) AS TOTAL_EU_SALES, SUM(jp_sales) AS TOTAL_JP_SALES FROM [dbo].[console_games]; Result: In North America, the total sales were 4310.5M copies, in Europe, it was 2382.36M and in Japan it was 1266.38M. So what if I had to get the total sales in the world. The easier method would be to create a column to have total sales. Challenge #2: Create a new column to get the total sales. ALTER TABLE [dbo].[console_games] ADD global_sales float; UPDATE [dbo].[console_games] SET global_sales = na_sales + eu_sales + jp_sales + other_sales; Result: I have a new column with the glob...
Comments
Post a Comment