Skip to content

HarshicPranav/IPL-SQL-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏏 IPL SQL Analysis (2008–2024)

Project Overview

An end-to-end SQL data analysis project on 17 seasons of IPL cricket data using PostgreSQL. This project analyzes 1,095 matches and 260,920 ball-by-ball deliveries to uncover strategic insights about team performance, player statistics, and winning patterns.

Tools Used

  • PostgreSQL 17
  • pgAdmin 4
  • GitHub

Dataset

  • Source: Kaggle β€” IPL Complete Dataset (2008–2024)
  • matches.csv β€” 1,095 matches
  • deliveries.csv β€” 260,920 ball-by-ball records

Business Questions Answered

🟒 Basic Analysis

  1. Which team has won the most IPL matches across all seasons?
  2. Which venue has hosted the most matches?
  3. How many matches were won by batting first vs fielding first?

🟑 Intermediate Analysis

  1. Which team has the best win % when they win the toss?
  2. Which batsman scored the most runs in death overs (17–20)?
  3. Which bowler has the best economy rate in powerplay overs (1–6)?
  4. Which teams perform best in home venues vs away venues?

πŸ”΄ Advanced Analysis

  1. Rank batsmen by total runs scored in each season using RANK() OVER
  2. Find players whose batting average improved every consecutive season
  3. Win % trend of each team year-over-year using LAG()
  4. Which bowler has taken the most wickets in Super Over situations?
  5. Top 5 clutch batsmen in high chase matches (180+ target)

πŸ† Capstone

  1. What combination of toss decision and batting order gives the highest win probability?

Key Findings

  • Mumbai Indians are the most successful team with 144 wins
  • Eden Gardens is the most hosted venue with 77 matches
  • Teams choosing to field first win 53.55% of matches vs 45.27% batting first
  • Gujarat Titans have the best toss-to-win conversion at 63.64%
  • MS Dhoni is the greatest death over batsman with 19,566 runs
  • Best winning combination: Win toss β†’ Choose to field β†’ Chase successfully (33.88%)

SQL Concepts Used

  • SELECT, WHERE, GROUP BY, ORDER BY, HAVING
  • JOINs, Subqueries, UNION ALL
  • CTEs (WITH clause)
  • Window Functions: RANK(), LAG(), PARTITION BY
  • CASE WHEN, NULLIF, ROUND
  • CAST, Regex filtering

About

IPL cricket Data Analysis Using postgreSQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors