Reference solution
The shape we check against. Compare it with your query: the set of rows matters, the formatting does not.
SELECT DISTINCT u.name AS user_name FROM users u JOIN posts p ON p.user_id = u.id WHERE u.active = 1 ORDER BY user_name;
Return the name (as user_name) of every active user who has written at least one post. Each user should appear once. Sort by name.
hint ladder
Write a query with WITH … AS (…) blocks, then inspect each intermediate table before the final SELECT.
Run your code to see its output, or check your solution to grade it.
Reference solution
The shape we check against. Compare it with your query: the set of rows matters, the formatting does not.
SELECT DISTINCT u.name AS user_name FROM users u JOIN posts p ON p.user_id = u.id WHERE u.active = 1 ORDER BY user_name;
Code is blurred until you solve this problem — the reasoning stays readable.