Home Skills SQL for Data Analysis (Beginner) CTEs and Introductory Window Functions Practice Free practice · Interactive SQL · hard
Practice Rank orders within each status
Return status, order_id, and ROW_NUMBER() as status_rank. Restart numbering for each status and rank larger amounts first, then order_id ascending. Sort the final result by status and status_rank.
Table relationships employees.manager_id→ employees.employee_idorders.customer_id→ customers.customer_idorders.sales_rep_id→ employees.employee_id
customers Customer profile fields used for account reporting.
6 rows Grain One row per customer
customer_idTEXT PK customer_nameTEXT cityTEXT state_codeTEXT segmentTEXT signup_dateTEXT Preview source rows employees Sales employees and their reporting relationships.
5 rows Grain One row per employee
employee_idTEXT PK employee_nameTEXT regionTEXT manager_idTEXT FK Preview source rows orders Order-level dates, statuses, owners, and USD amounts.
7 rows Grain One row per order
order_idTEXT PK customer_idTEXT FK order_dateTEXT statusTEXT sales_rep_idTEXT FK order_amountREAL Preview source rows SQL query Run query Reset query Changes to this practice database are never saved.
Show hint
Ready to check your work? Edit the starter query, run it, then compare your result with the task.
Check Work