Chapter 9 · Interview Level
04. Extract Year from Order Dates
Easy10 XPE-Commerce
The reporting team needs order counts broken down by year. Write a query that extracts the year from order_date and counts the number of orders per year. Return the year and order_count, sorted by year.
Tables
- PKidINT
- FKcustomer_id→ customers.idINT
- order_dateTEXT
- statusTEXT
- total_amountREAL
Need help?
Ask Sol
AI tutor — looks at your current query and nudges you, without spoiling the answer.
Solution
Try the hints first — solving it yourself is what makes it stick.