Task 7: Create a view named MONTHLY_RENTS. It consists of three columns: the first is the number of bedrooms, the second is the average square feet, and the third is the average monthly rent for all properties in the PROPERTY table that have that number of bedrooms. Use BEDROOMS, AVG_SQUARE_FEET, and AVG_MONTHLY_RENT as the column names. Group and order the rows by number of bedrooms.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
Task 7: Create a view named MONTHLY_RENTS. It consists of three columns: the first is the number of bedrooms, the second is the average square feet, and the third is the average monthly rent for all properties in the PROPERTY table that have that number of bedrooms. Use BEDROOMS, AVG_SQUARE_FEET, and AVG_MONTHLY_RENT as the column names. Group and order the rows by number of bedrooms.
Task 8: Write and execute the command to retrieve the average square footage and average monthly rent for each property for which the average monthly rent is greater than $1,400.
Task 9: Without using the MONTHLY_RENTS VIEW, write and execute the command to retrieve the average square footage and average monthly rent for each property for which the average monthly rent is less than $1,400.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
This was the answer I calculated too for Task 8: Write and execute the command to retrieve the average square footage and average monthly rent for each property for which the average monthly rent is greater than $1,400.
The answer expected is not the answer that was generated. Why isn't the correct answer and why isthe generated and expected different. Thanks
My answer
AVG_SQUARE_FEET | AVG_MONTHLY_RENT |
---|---|
2100.0000 | 1900.0000 |
1750.0000 | 1650.0000 |
2125.0000 | 2050.0000 |
1537.5000 | 1700.0000 |
2700.0000 | 2750.0000 |
1300.0000 | 1600.0000 |
Expected Results
AVG_SQUARE_FEET | AVG_MONTHLY_RENT |
---|---|
1545.0000 | 1610.0000 |
2112.5000 | 1975.0000 |
2700.0000 | 2750.0000 |