0

How can I write this code SQL

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

22nd Sep 2021, 6:12 AM
Badar Adam Taha
Badar Adam Taha - avatar
3 Answers
0
Badar Adam (‫ۚۯ۱ Ű§ŰŻÙ…â€Źâ€Ž) first get average of 'not rented' appartments then compare average with prices, if prices are greater than average then display results and results should be sorted by 'Price' column.
22nd Sep 2021, 7:46 AM
AÍąJ
AÍąJ - avatar
0
Select * From apartments Where price > (select Avg (price) from apartments) And status = ‘Not rented’ Order by price;
22nd Sep 2021, 1:38 PM
Kazi
Kazi - avatar
0
Not working
2nd Oct 2021, 4:45 AM
Badar Adam Taha
Badar Adam Taha - avatar