This dataset contains a list of video games with sales greater than 100,000 copies. It was generated by a scrape of vgchartz.com.
Fields include:
- Rank : Ranking of overall sales
- Name : The games name
- Platform : Platform of the games release (i.e. PC,PS4, etc.)
- Year : Year of the game's release
- Genre : Genre of the game
- Publisher : Publisher of the game
- NA_Sales : Sales in North America (in millions)
- EU_Sales : Sales in Europe (in millions)
- JP_Sales : Sales in Japan (in millions)
- Other_Sales : Sales in the rest of the world (in millions)
- Global_Sales : Total worldwide sales.
To execute this SQL statement in pgAdmin:
- Open pgAdmin and connect to your database.
- Right-click on your database and select Query Tool.
- Copy and paste the SQL statement into the query window.
CREATE TABLE video_game_sales (
rank INT,
name VARCHAR(255),
platform VARCHAR(50),
year INT,
genre VARCHAR(50),
publisher VARCHAR(100),
na_sales FLOAT,
eu_sales FLOAT,
jp_sales FLOAT,
other_sales FLOAT,
global_sales FLOAT
);
- Click the Execute button (or press F5) to run the query and create the table.
- Import
video_game_sales.cv
Here are some example questions that you can use for data analysis with your video_game_sales
table in PostgreSQL.
- What are the top 10 games by global sales?
SELECT
name,
global_sales
FROM video_game_sales
ORDER BY global_sales DESC
LIMIT 10
- Which platform has the most games in the top 100 global sales?
SELECT
platform,
COUNT(*) AS game_count,
SUM(global_sales) AS total_sales
FROM video_game_sales
GROUP BY platform
ORDER BY total_sales DESC, game_count DESC
LIMIT 100
- What are the total sales in North America, Europe, Japan, and other regions?
SELECT
SUM(na_sales) AS na_total_sales,
SUM(eu_sales) AS eu_total_sales,
SUM(jp_sales) AS jp_total_sales,
SUM(other_sales) AS other_total_sales
FROM video_game_sales
- What is the average global sales per genre?
SELECT
genre,
ROUND(AVG(global_sales)::numeric,2) AS average_global_sales
FROM video_game_sales
GROUP BY genre
ORDER BY average_global_sales DESC
- Which publisher has the highest average global sales per game?
SELECT
publisher,
ROUND(AVG(global_sales)::numeric,2) AS average_global_sales
FROM video_game_sales
GROUP BY publisher
ORDER BY average_global_sales DESC
LIMIT 10
- What are the total sales by year?
SELECT
year,
SUM(global_sales) AS total_sales
FROM video_game_sales
GROUP BY year
ORDER BY year DESC
- Which genre has the most games in the dataset?
SELECT
genre,
COUNT(*) AS game_count
FROM video_game_sales
GROUP BY genre
ORDER BY game_count DESC
- What is the percentage of total global sales for each platform?
SELECT platform,
SUM(global_sales) AS total_sales,
SUM(global_sales) * 100.0 / SUM(SUM(global_sales)) OVER () AS per_sales
FROM video_game_sales
GROUP BY platform
ORDER BY total_sales DESC;
- Find the game with the highest sales in North America for each year.
SELECT DISTINCT
year,
name,
na_sales
FROM video_game_sales
WHERE year IS NOT null
ORDER BY year DESC, na_sales DESC
- Which game had the highest combined sales in Europe and Japan?
SELECT
name,
eu_sales,
jp_sales,
(eu_sales + jp_sales) AS eu_jp_sales
FROM video_game_sales
ORDER BY eu_jp_sales DESC
LIMIT 5
https://public.tableau.com/app/profile/bilge.akar/viz/Book1_17228780802550/Video_game_sale_dashboard