⚡ 0 XP
Step 1 of 2
Two conditions at once
Join conditions with AND and OR:
AND: both must be true — team = 'Delhi' AND role = 'Batter'OR: at least one must be true — team = 'Delhi' OR team = 'Mumbai'
When you mix them, use brackets so SQL knows what you mean: WHERE role = 'Bowler' AND (team = 'Delhi' OR team = 'Mumbai').
ExampleSELECT name, team
FROM players
WHERE role = 'Batter'
AND runs > 1500;
🎯 Challenge: All-rounders who take wickets +15 XP
Show name, team and wickets of players whose role is All-rounder and who took 30 or more wickets.
Try twice to unlock the solution (0/2)
query.sqlCtrl ⏎
Tables (practice database)
Results
Press Run to see your query’s rows here.
Checklist
Press Run to check your code.
Lesson notes (text version)
1. Two conditions at once
Join conditions with AND and OR:
AND: both must be true — team = 'Delhi' AND role = 'Batter'OR: at least one must be true — team = 'Delhi' OR team = 'Mumbai'
When you mix them, use brackets so SQL knows what you mean: WHERE role = 'Bowler' AND (team = 'Delhi' OR team = 'Mumbai').
SELECT name, team
FROM players
WHERE role = 'Batter'
AND runs > 1500;
Challenge: All-rounders who take wickets
Show name, team and wickets of players whose role is All-rounder and who took 30 or more wickets.
2. Lists and ranges: IN, BETWEEN
Two handy shortcuts:
team IN ('Delhi', 'Kolkata') is the same as team = 'Delhi' OR team = 'Kolkata'matches BETWEEN 30 AND 38 is the same as matches >= 30 AND matches <= 38 — both ends are included
They make long conditions short and easy to read.
SELECT name, team
FROM players
WHERE team IN ('Chennai', 'Mumbai');
Challenge: Delhi and Kolkata regulars
Show name, team and matches of players whose team is Delhi or Kolkata (use IN) and who played between 30 and 38 matches, both included (use BETWEEN).