Its Project 2: Ipl Data Analysis
Its Project 2: Ipl Data Analysis
belong to which country and so on. With this database, we can find queries like: list of all
the right-handed players etc.
4. Player match- This database consists of information like player_id, team it belongs to etc.
This database can help us finding queries between two or more different databases.
5. Season -This database has information years with season number. It also has information
like player_id of orange cap and purple cup winners. With this database we can find queries
like which player won orange cap for which season etc.
6. Teams -This database consists of teams and short code for team name. This database can
help in finding query like which player belong to which team.
List of queries:
Question 1: List of all the matches where Duckworth Lewis has been used to decide the
result of the match.
Command:
SELECT Match_Date
FROM `match`
WHERE Is_DuckWorthLewis=1;
Output:
Match_Date
17-May-08
18-May-08
19-Apr-09
21-Apr-09
07-May-09
18-Apr-11
07-May-11
14-May-11
10-May-14
22-Apr-15
15-May-15
26-Apr-16
14-May-16
17-May-16
18-May-16
In the case of rain, Duckworth Lewis method is used to make the result fairly.
Output:
Team_Name
3
Command :
SELECT Team_Name
FROM `team`
WHERE Team_Id IN (SELECT Team_Name_Id FROM `match` WHERE Toss_Winner_Id=Match_Winner_Id AND
Toss_decision='bat')
Output:
Team_Name
During the toss, the team which wins the toss, choose between bowling and
batting according the preferred situations.
Question 4: How many times Virat Kohli (player Id-8) has won man of the match.
Command :
SELECT COUNT(Man_Of_The_Match_Id)
FROM `match`
WHERE Man_Of_The_Match_Id=8
Output:
COUNT(Man_Of_The_Match_Id)
4
11
The true performance of any player is represented by the no. of awards he/she
gets, here it is the Man of The Match award.
Question 5: List of all players who bat with left hand and bowl with right hand.
Command :
SELECT Player_Name
FROM `player`
WHERE Batting_Hand='Left_Hand' AND Bowling_Skill='Right-arm medium'
Output:
Player_Name
SC Ganguly
ML Hayden
MEK Hussey
AM Nayar
TM Srivastava
JD Ryder
RJ Quiney
Anirudh Singh
EJG Morgan
MJ Lumb
S Narwal
FY Fazal
MS Wade
TR Birt
Harpreet Singh
JDS Neesham
UT Khawaja
A multi talented player is those player who can use both of his/her hand
whether in batting or bowling perfectly.
Command :
SELECT Match_Date
FROM `match`
WHERE Venue_Name='Eden Gardens'
Output:\
Match_Date
20-Apr-08
29-Apr-08
08-May-08
13-May-08
18-May-08
20-May-08
25-May-08
5
14-Mar-10
16-Mar-10
01-Apr-10
04-Apr-10
07-Apr-10
17-Apr-10
19-Apr-10
11-Apr-11
17-Apr-11
20-Apr-11
22-Apr-11
30-Apr-11
07-May-11
22-May-11
05-Apr-12
13-Apr-12
15-Apr-12
28-Apr-12
Maximum no. of matches are played in those grounds which fulfils all the
requirement of the tournament.
Question 7: List number of times when match Id=3 wins at Eden Gardens.
Command :
SELECT COUNT(Match_Winner_Id)
FROM `match`
WHERE Match_Winner_Id=3 AND Venue_Name='Eden Gardens'
Output:
COUNT(Match_Winner_Id)
4
Question 8: In which season the player with Id=162 won the orange cap
Command :
SELECT Season_Year
FROM `season`
WHERE Orange_Cap_Id=162
Output:
Season_Year
2011
2012
A player who scores highest runs in any particular match got orange cap in IPL
and it truly depicts the batting performance of the player.
6
Command :
SELECT Player_Name
FROM `player`
WHERE Player_no IN(SELECT Player_Id FROM `playermatch` WHERE Team_Id=1)
Output:
Player_Name
SC Ganguly
BB McCullum
RT Ponting
DJ Hussey
Mohammad Hafeez
JH Kallis
MV Boucher
YK Pathan
G Gambhir
RV Uthappa
SB Bangar
WP Saha
LR Shukla
B Lee
PP Chawla
R Vinay Kumar
AB Agarkar
M Kartik
I Sharma
MK Tiwary
R Bhatia
DB Das
MK Pandey
Salman Butt
BJ Hodge
Command :
SELECT Player_Name
FROM `player`
WHERE Batting_Hand='Left_Hand'
Output:
Player_Name
SC Ganguly
SB Joshi
PA Patel
ML Hayden
MEK Hussey
SK Raina
JDP Oram
K Goel
KC Sangakkara
Yuvraj Singh
7
SM Katich
IK Pathan
DS Lehmann
RA Jadeja
G Gambhir
S Dhawan
ST Jayasuriya
AM Nayar
S Chanderpaul
AC Gilchrist
WPUJC Vaas
PP Chawla
GC Smith
SS Tiwary
M Kartik
In IPL most of the player is right handed batsman but it also have left handed
batsman particularly from India.
Output:
Player_Name
SC Ganguly
BB McCullum
RT Ponting
DJ Hussey
R Draveed
V Kohli
CL White
Z Khan
PA Patel
MS Dhoni
SK Raina
JR Hopes
KC Sangakkara
Yuvraj Singh
SR Watson
SK Warne
G Gambhir
V Sehwag
S Dhawan
SM Pollock
Harbhajan Singh
LRPL Taylor
AC Gilchrist
VVS Laxman
RG Sharma
In every team there is a leader which directs the team in right direction, in
cricket it is a captain who holds this position.
Command :
SELECT Player_Name
FROM `player`
WHERE Is_Umpire=1
Output:
Player_Name
Asad Rauf
MR Benson
Aleem Dar
SJ Davis
BF Bowden
IL Howell
DJ Harper
RE Koertzen
BR Doctrove
AV Jayaprakash
BG Jerling
M Erasmus
HDPK Dharmasena
S Asnani
GAV Baxter
SS Hazare
K Hariharan
SL Shastri
SK Tarapore
S Ravi
SJA Taufel
S Das
AM Saheba
PR Reiffel
JD Cloete
The role of umpires is to observe the every action that happens during matches
in detail and take decision accordingly.
Question 13: How many times a team won toss and choose to field first in wankhade
stadium.
Command :
SELECT COUNT(Match_Id)
FROM `match`
WHERE Venue_Name='Wankhede Stadium' AND Toss_Decision='field'
Output:
COUNT(Match_Id)
29
After the toss, the captain of toss winning team was asked to choose to take
either batting first or bowling first.
Command :
SELECT COUNT(Match_Id)
FROM `match`
WHERE Team_Name_Id=2 AND Opponent_Team_Id=1 AND Match_Winner_Id=1
Output:
COUNT(Match_Id)
4
Whether a team is better than the any other particular team is justified by the
no. of times former team wins against the latter team.
Question 15: For how many teams did player id 17 played for in the IPL history?
Command :
SELECT Team_Name
FROM `team`
WHERE Team_Id IN (SELECT DISTINCT Team_Id FROM `playermatch` WHERE Player_Id=17)
Output:
Team_Name
Loyalty of any particular player towards any team is judged by his consistency
in that particular team.
Story Findings-
Cricket is a simple game you win or you loose but there is a lot of grey area as well. It is a
battle of nerves as much as it is test of skill. Lot of games in IPL go down to wire, let us see
which teams and players had withstand pressure and win games, all the questions are
answered by analysing the IPL database such as –