Created
April 10, 2017 22:03
-
-
Save harsha547/397c5a225a8cb55a4484459b6fa6609b to your computer and use it in GitHub Desktop.
Metrics in Indian Premier League ( 2008 - 2016 )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Important metrics in IPL ( 2008 - 2016 ) | |
SELECT 'Matches' As Dimension , COUNT(*) As 'Measure' | |
FROM Match | |
UNION ALL | |
SELECT 'Extra_Runs' As Dimension , SUM(Extra_Runs.Extra_Runs) As 'Measure' | |
FROM Extra_Runs | |
UNION ALL | |
SELECT 'Batsman_runs' As Dimension , SUM(B.Runs_Scored) As 'Value' | |
FROM Batsman_Scored B | |
UNION ALL | |
SELECT 'Wickets' As Dimension , COUNT(*) As 'Measure' | |
FROM Wicket_Taken | |
UNION ALL | |
SELECT 'Sixes' As Dimension , COUNT(*) As 'Measure' | |
FROM Batsman_Scored | |
WHERE Batsman_Scored.Runs_Scored = 6 | |
UNION ALL | |
SELECT 'Fours' As Dimension , COUNT(*) As 'Measure' | |
FROM Batsman_Scored | |
WHERE Batsman_Scored.Runs_Scored = 4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution 👍