Intermediate
SQL Query Constructor
Generate SQL queries based on natural language requirements.
📝 Konten Prompt
Write a SQL query for a PostgreSQL database. The database has two tables: 'employees' (id, name, department_id, salary) and 'departments' (id, name). The query should return the names of all departments and the average salary of employees in those departments, but only include departments where the average salary is greater than 50,000. Order the results by average salary in descending order.