+ 4
SQL Apartments question.
So this is the code that I wrote and it passed... SELECT * FROM Apartments WHERE price > (SELECT AVG(price) FROM Apartments) ORDER BY price; But it also tells you to account for status and to only include rows with status = "Not Rented". So say I have a Apartment that is greater than price but also "Rented", how would I incorporate that into the command? I couldn't figure it out...
1 Answer
+ 5
You can add multiple conditions to your WHERE clause.
Text must be enclosed by apostrophes (single quote).
SELECT *
FROM Apartments
WHERE price > (SELECT AVG(price) FROM Apartments)
AND status = Not Rented
ORDER BY price;
(the forum does not allow me to save with single quotes)