Three questions using only Part 1. Expected rows first, then the answer behind a tap. First ball of the innings: play yourself in.
1. Spinners, alphabetically
All spin bowlers (any bowling style containing "spin"), with their team code and style, sorted by style and then name.
| PLAYER_NAME | TEAM_CODE | BOWLING_STYLE |
|---|---|---|
| Arvind Selvam | CHN | Left-arm spin |
| Asif Mirza | KHI | Left-arm spin |
| Imraan Patel | DBN | Left-arm spin |
| Sione Fifita | AKL | Left-arm spin |
| Tyler Vance | TPA | Left-arm spin |
| Will Ashdown | LDS | Left-arm spin |
| Archie Muir | AKL | Right-arm leg-spin |
| Ethan Park | TPA | Right-arm leg-spin |
| Freddie Lowe | LDS | Right-arm leg-spin |
| Senthil Murugan | CHN | Right-arm leg-spin |
| Yusuf Moosa | DBN | Right-arm leg-spin |
| Zubair Lodhi | KHI | Right-arm leg-spin |
| Danish Ansari | KHI | Right-arm off-spin |
| George Pembury | LDS | Right-arm off-spin |
| Harish Kumar | CHN | Right-arm off-spin |
| Nikhil Rao | TPA | Right-arm off-spin |
| Rory Paterson | AKL | Right-arm off-spin |
Try itShow the answer
select p.player_name, t.team_code, p.bowling_style
from cr_players p
join cr_teams t on t.team_id = p.team_id
where p.bowling_style like '%spin%'
order by p.bowling_style, p.player_name;
select p.player_name, t.team_code, p.bowling_style
from cr_players p
join cr_teams t on t.team_id = p.team_id
where instr(p.bowling_style, 'spin') > 0
order by p.bowling_style, p.player_name;
2. Close finishes
Every match won by fewer than 10 runs or with only 1 or 2 wickets left, plus any tie. Show match, season, how it ended and the margin ("tie" for a tie).
| MATCH_ID | SEASON | RESULT | MARGIN |
|---|---|---|---|
| 10 | 2025 | tie | tie |
| 15 | 2025 | runs | 5 |
| 20 | 2026 | wickets | 2 |
| 21 | 2026 | wickets | 2 |
| 31 | 2026 | wickets | 2 |
Try itShow the answer
select match_id, season,
case win_type when 'TIE' then 'tie' else lower(win_type) end as result,
nvl(to_char(win_margin), 'tie') as margin
from cr_matches
where (win_type = 'RUNS' and win_margin < 10)
or (win_type = 'WICKETS' and win_margin <= 2)
or win_type = 'TIE'
order by match_id;
select match_id, season,
decode(win_type, 'TIE', 'tie', lower(win_type)) as result,
coalesce(to_char(win_margin), 'tie') as margin
from cr_matches
where win_type = 'TIE'
or win_margin < case win_type when 'RUNS' then 10 when 'WICKETS' then 3 end
order by match_id;
NVL(TO_CHAR(win_margin), 'tie'): the margin is a number, so it's turned into text first; NVL
needs both arguments to be the same type.
3. Born in the 2000s
Players born on or after January 1, 2000, youngest first, with their birth year.
| PLAYER_NAME | BIRTH_YEAR |
|---|---|
| Alfie Dunn | 2002 |
| Isaac Ruane | 2002 |
| Dinesh Varma | 2001 |
| Omer Farooq | 2001 |
| Devon Price | 2001 |
| Ethan Naidoo | 2001 |
| Archie Muir | 2000 |
| Naveen Reddy | 2000 |
| Freddie Lowe | 2000 |
| Waqas Jamil | 2000 |
| Yusuf Moosa | 2000 |
| Ethan Park | 2000 |
Try itShow the answer
select player_name, extract(year from born) as birth_year
from cr_players
where born >= date '2000-01-01'
order by born desc;
select player_name, to_number(to_char(born, 'YYYY')) as birth_year
from cr_players
where to_char(born, 'YYYY') >= '2000'
order by born desc;
The first way is better: born >= date '2000-01-01' can use an index on born; wrapping the
column in TO_CHAR usually can't. Same rows today, different speed on a big table.
Part 1 quiz
5 questions on all of Part 1. Get 4 right to pass. Retake it as often as you like.