Chapter 18mChallenge
SQL Introduction — Challenge
Query language for databases.
This content is not yet available in ta. Showing English version.
View in English →Apply what you've learned. Each challenge includes starter code and test cases.
Products per Category
mediumProducts 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 |
STARTER CODE
-- Group products by category and count
1 test cases
Start ChallengeAdults in India
easyAdults 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 |
STARTER CODE
-- Write your SQL query below
1 test cases
Start Challenge