This project focuses on decoding player gaming behavior using SQL.
It was completed as part of the Mentorness Data Analytics Program and demonstrates advanced use of MySQL for data analysis.
Two datasets containing player histories — including IDs, kill counts, device types, levels, and difficulty — were analyzed to answer 15 structured business questions.
The analysis showcases the use of:
- Window Functions
- Aggregate Functions
- Subqueries (Nested Queries)
- Stored Procedures
- Import and clean two datasets containing gaming session data.
- Analyze player performance metrics such as kills, scores, and difficulty levels.
- Decode behavioral patterns using SQL queries.
- Practice advanced SQL operations and logical problem-solving.
Two datasets were provided containing information about:
- Player IDs (
P_ID
) - Device IDs (
Dev_ID
) - Levels, Difficulty, and Scores
- Kill Counts, Lives Earned, and Stages Crossed
- Datetime fields (
start_datetime
,first_login
, etc.)
The first column in both datasets (column1
) served as an index and was not used in the analysis.
- Window Functions: Ranking, cumulative sums, and running totals
- Aggregate Functions:
SUM()
,AVG()
,COUNT()
, etc. - Subqueries: Used to filter and calculate comparative statistics
- Stored Procedures: Automating repetitive ranking tasks
- Ordering and Grouping: To extract insights per player, device, and difficulty level
Here are some examples of the 15 queries analyzed:
- Extract all players at Level 0 with their IDs, device IDs, and difficulty levels.
- Find average kill count per Level 1 code for players with 2 lives and at least 3 stages crossed.
- Calculate the total number of stages crossed per difficulty level for Level 2 players using
zm_series
devices. - Identify players who have played on multiple days.
- Compute the level-wise sum of kills exceeding the average kill count for Medium difficulty.
- Create a stored procedure to rank the top
n
headshots_count
for each device ID.
The analysis provided insights such as:
- Variation in player performance based on difficulty level and device type
- Identification of top-performing players across levels and sessions
- Patterns in login activity and kill count progression over time
- Practical application of SQL analytical capabilities in real-world data exploration