0
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. What is wrong with this code?! 1SELECT * FROM Apartments 2 WHERE AVG (Price)< price AND Status = Notrented 3 ORDER BY Price
5 Antworten
+ 4
Status is a string so notrented should be inside single quotes.
And you have to get AVG of price then compare with price so there should be
price > (SELECT AVG(price) FROM appartments)
0
Project 28 ZOO
0
Also this one :
SELECT Names FROM Cake
WHERE calories <= 100
ORDER BY calories
LIMIT 3 ;
0
Neda Soufieh
You have to select all columns data not only Names and also no need to compare calories. That's not in task. So remove calories <= 100
Read task carefully and do accordingly, don't write anything else.
0
Neda Soufieh
In Zoo project first insert new data then select data using JOIN