VIP 👤
🏠 Hem
Benchmarkar
📊 Alla benchmarkar 🦖 Dinosaur v1 🦖 Dinosaur v2 ✅ To-Do List-applikationer 🎨 Kreativa fria sidor 🎯 FSACB - Ultimata uppvisningen 🌍 Översättningsbenchmark
Modeller
🏆 Topp 10 modeller 🆓 Gratis modeller 📋 Alla modeller ⚙️ Kilo Code
Resurser
💬 Promptbibliotek 📖 AI-ordlista 🔗 Användbara länkar 🔌 AI-API:er och routrar
Medium

Advanced SQL Query

#sql #database #query

Write a complex SQL query involving joins and aggregation.

Write a SQL query for a database with two tables: 'Employees' (id, name, department_id) and 'Salaries' (employee_id, amount, year). The query should list the names of employees in the 'Sales' department who earned an average salary higher than $50,000 over the years available in the database. Sort the results by the average salary in descending order.