SQLDAXExcelPython
LeaderboardRunLifetime
JoinsHard30 points

Return rate by category

For each Category, return the category and the share of its sales lines that have a row in Returns, as a decimal rounded to 4 places (0.05 means 5%).

Hard questions are part of Lifetime and Pro. Read it here, and unlock running and checking your answer from the plans.

Show solutionLifetime

Runs in your browser with DuckDB, whose SQL is close to PostgreSQL. Nothing you type is sent to a server unless you save a score.

SQLselect text to run only that part
Loading editor…

Press Ctrl+Enter or Run to see the result here.