SQL Apartments | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

SQL Apartments

Hello, I tried this query: https://pastebin.com/1AjhN55R The output is: id,city,address,price,status Where is my mistake?

17th Feb 2021, 4:38 AM
Anis Ali Khan
9 Respostas
+ 19
Here is my code You can try it. It surely help you. SELECT * FROM Apartments WHERE price>=(SELECT AVG(price)FROM Apartments) ORDER BY price;
18th Feb 2021, 1:42 AM
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø - avatar
+ 3
Anis Ali Khan Problem is with SQL Compiler not your script. https://www.sololearn.com/post/935054/?ref=app
17th Feb 2021, 5:33 AM
AĶ¢J
AĶ¢J - avatar
+ 2
My code SELECT * FROM Apartments WHERE price > (SELECT AVG(price) FROM Apartments AND status != ā€˜Rentedā€™ ORDER BY price;
5th May 2021, 9:16 PM
Łukasz Śmietanka
Łukasz Śmietanka - avatar
0
Happy coding
18th Feb 2021, 1:46 AM
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø - avatar
0
Most welcome šŸ‘
22nd Feb 2021, 1:11 PM
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø - avatar
0
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø It tells you to also account for status being "Not Rented". I know it turns out that you don't need to include it but if I had to what would it look like?
2nd May 2022, 2:45 AM
Dylan Campbell
Dylan Campbell - avatar
- 1
thank you. I also had to delete the second subcondition.
18th Feb 2021, 1:45 AM
Anis Ali Khan
- 1
Most welcome šŸ‘
18th Feb 2021, 1:46 AM
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø
ā¤ļøšŸ˜PreranašŸ˜ā¤ļø - avatar
21st Feb 2021, 10:19 PM
Enrique Arias
Enrique Arias - avatar