You don't need to love cricket to use this guide. You do need to know what a few words mean, because the questions are asked in cricket terms: "a hat-trick", "a maiden over", "the chase". This page covers the version of the game in our data, called T20 (Twenty20), and nothing more.
If you know baseball, a lot of this will feel familiar: one side bats, the other side bowls and fields, and then they swap.
The match in one paragraph
Two teams of eleven players. Each team bats once; one turn at batting is called an innings (always with the "s", even for one). The team batting first scores as many runs as it can in at most 20 overs. Then the other team bats and tries to beat that score, which is called the chase. The team with more runs wins.
Overs and balls
- One throw from the bowler to the batter is a delivery, or a ball.
- An over is six legal deliveries by the same bowler. Then a different bowler bowls the next over from the other end of the pitch.
- In T20 an innings lasts at most 20 overs, which is 120 legal balls.
- A bowler can bowl at most 4 overs in an innings, and never two overs in a row.
Scorers write the progress of an innings as overs and balls: 15.2 means "15 overs done,
plus 2 balls of the 16th". So the first ball of the match is 0.1 and the last possible
one is 19.6. Our CR_BALLS_V view has this in the OVER_BALL column, and OVER_NO
(1 to 20) says which over it is.
Batting
Two batters are on the field at a time, one at each end of the pitch:
- The striker faces the ball. The non-striker waits at the bowler's end.
- After hitting the ball, the batters can run to swap ends. Each swap is one run (so 1, 2 or 3 runs).
- If the ball reaches the edge of the field (the boundary) along the ground, that's 4 runs. If it clears the boundary in the air, 6 runs. A boundary means a four or a six.
- If the batters run an odd number of runs, they've swapped ends, so the other batter is now the striker. At the end of every over the strike changes too, because the next over is bowled from the other end.
A ball with no runs scored at all is a dot ball (scorers show it as a dot). Six dot balls in an over make a maiden over: the bowler gave away nothing.
Getting out
A batter who is out is replaced by the next one in the batting order. When 10 wickets have fallen (ten batters out, with one left who can't bat alone) the team is all out and its innings ends, even if overs are left. "A wicket" means one batter getting out.
The ways of getting out in our data:
| How | What happened | Bowler gets the credit? |
|---|---|---|
| bowled | The ball hit the stumps (the wooden target behind the batter) | Yes |
| caught | A fielder caught the hit before it bounced | Yes |
| lbw (leg before wicket) | The ball hit the batter's leg when it would have hit the stumps | Yes |
| stumped | The wicketkeeper broke the stumps while the batter was out of the crease | Yes (spin bowlers, in our data) |
| run out | A fielder broke the stumps while the batters were running | No: it's a fielding dismissal |
So "the bowler took 3 wickets" counts bowled, caught, lbw and stumped, but not run outs.
In CR_BALLS_V, IS_WICKET counts every dismissal and IS_BOWLER_WICKET only the bowler's.
A hat-trick is when a bowler takes wickets with three consecutive deliveries of their own. Those three balls can be spread over two of the bowler's overs, with someone else's over in between. That detail turns out to matter a lot for SQL (see Part 6).
Extras: runs nobody hit
Some runs are given to the batting team without coming off the bat. They're called extras:
| Extra | Code | What it is | Counts as one of the over's six balls? |
|---|---|---|---|
| Wide | WD |
The ball was out of the batter's reach. 1 run | No, bowled again |
| No-ball | NB |
The bowler overstepped. 1 run, plus whatever the batter hits | No, bowled again |
| Leg-bye | LB |
Runs taken after the ball hit the batter's body | Yes |
| Bye | B |
Runs taken after the ball missed everyone | Yes |
This is why an over can have seven or eight deliveries but only six legal ones. In the
data, BALL_NO counts every delivery in the over, and IS_LEGAL tells you which ones count.
Who wins
- The team batting first sets a score, say 162/6 (162 runs, 6 wickets down). The chasing team's target is one more: 163.
- If the chasing team reaches 163, it wins by wickets: by how many of its 10 wickets it still had. Reaching it with 4 down is "won by 6 wickets". The chase stops the moment the target is reached, which is why second innings are often shorter than 20 overs.
- If the chasing team falls short, the team batting first wins by runs: by the difference.
- Equal scores: a tie. (Real leagues then play a one-over "super over". Ours just records the tie, and everyone goes home slightly confused.)
Before the match, the captains toss a coin. The winner of the toss chooses to bat first or field (bowl) first.
Note: in some countries the score is written the other way round, wickets first (6/162). We use runs/wickets.
Words you'll meet in the questions
| Word | Means |
|---|---|
| Powerplay | Overs 1 to 6, when fielding restrictions make scoring easier |
| Death overs | Overs 17 to 20, when batters swing for big hits |
| Partnership | Runs two batters scored together, between one wicket and the next |
| Collapse | Several wickets falling for very few runs |
| Strike rate | Batting: runs per 100 balls faced. 30 runs off 20 balls is a strike rate of 150 |
| Economy rate | Bowling: runs given away per over |
| Run rate | Runs per over for a team |
| Fall of wickets | The team's score at the moment each wicket fell, like 48/4 then 54/5 |
| Player of the match | The award for the best performance of the match |
From the field to the tables
| On the field | In the data |
|---|---|
| The league, its teams and grounds | CR_TEAMS, CR_VENUES |
| The squads (12 players per team) | CR_PLAYERS (role: BAT, BOWL, AR all-rounder, WK wicketkeeper) |
| A match: date, toss, result | CR_MATCHES |
| Every delivery: who bowled it to whom, what happened | CR_DELIVERIES, one row per ball |
| The same, with handy columns already worked out | CR_BALLS_V |
One row of CR_DELIVERIES is one ball. That's the beauty of cricket for SQL: a match is a long,
ordered list of small events, exactly the shape that window functions and
MATCH_RECOGNIZE are built for.