Finally, I am sharing all the resources which might help you to try something new on Indian Premier League Database. started with the intention to create a Normalized database for all the 577 matches in Microsoft SQL Server which might help other people to learn SQL Queries.

Resources :

End-to-End Example :

For suppose, If I want to visualize year wise team boundaries ( sixes and fours) in Tableau. write a SQL Query as mentioned below.

SELECT Team.Team_Name,season.season_year, Sum ( CASE WHEN batsman_scored.runs_scored = 4 THEN 1 ELSE 0 END ) AS 'Fours' , Sum ( CASE WHEN batsman_scored.runs_scored = 6 THEN 1 ELSE 0 END ) AS 'Sixes' FROM MATCH INNER JOIN season ON match.season_id = season.season_id INNER JOIN batsman_scored ON batsman_scored.match_id = match.match_id INNER JOIN Team ON Match.Team_1 = Team.Team_Id GROUP BY Team.Team_Name,Season.season_year

Below is the sample output for above mentioned Query.

If you are using Tableau Public Version, copy the data from the SQL Server to Microsoft Excel and then visualize it. otherwise If you are using Tableau Desktop,write a Custom SQL in Data Source tab.

As per the below visualization, Royal Challengers Bangalore is in the first place either due to their hard-hitting batsman's like Chris Gayle , Virat Kohli etc.., or it could be due to shorter boundaries in Chinnaswamy stadium, Bangalore.(Home Ground)

One more Visualization Head-To-Head Matches :





Thank You Andy Cotgreave , Andy Kribel and Ben Sullin..















