Write a query to output the apartments whose prices are greater than the average and are also not rented, sorted by the 'Price' | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Write a query to output the apartments whose prices are greater than the average and are also not rented, sorted by the 'Price'

Question

22nd Feb 2022, 1:56 PM
Amit
Amit - avatar
2 Answers
+ 2
SELECT * FROM Apartments WHERE price >= (SELECT AVG(price) FROM Apartments ) ORDER BY price;
22nd Feb 2022, 1:57 PM
Amit
Amit - avatar
+ 2
And your question is❓
22nd Feb 2022, 2:59 PM
Simba
Simba - avatar