Code Challenges
Code challenges for SQL. Each challenge links to its lesson page where you can solve it with live code execution.
2 challenges · 1 lessons01SQL Introduction
2 challenges# Products per Category
Write a query that shows each product `category` and the number of products in it (`COUNT(*)`), aliased as `n`.
## Expected Result
| category | n |
|----------|---|
| Accessories | 2 |
| Electronics | 4 |
| Stationery | 2 |medium# Adults in India
Write a SQL query that returns the `name` and `age` of all users where `age >= 18` AND `country = 'India'`, ordered by `age` descending.
## Expected Result
| name | age |
|------|-----|
| Rahul Verma | 25 |
| Aarav Sharma | 22 |
| Priya Patel | 19 |easy