Question: 1 . Create a view named SMALL _ PROPERTY. It consists of the property ID , office number, bedrooms, floor, monthly rent, and owner number

1. Create a view named SMALL_PROPERTY. It consists of the property ID, office number, bedrooms, floor, monthly rent, and owner number for every property whose square footage is less than 1,250 square feet.
a. Write and execute the CREATE VIEW command to create the SMALL_PROPERTY view.
b. Write and execute a query to retrieve the office number, property ID, and monthly rent for every property in the SMALL_PROPERTY view with a monthly rent of $1150 or more.
c. Write and execute the query that the DBMS actually executes.
d. Does updating the database through this view create any problems? If so, what are they? If not, why not?
Click or tap here to enter text.
2. Create a view named PROPERTY_OWNERS. It consists of the property ID, office number, square footage, bedrooms, floors, monthly rent, and owners last name for every property in which the number of bedrooms is three.
a. Write and execute the CREATE VIEW command to create the PROPERTY_OWNERS view.
b. Write and execute the command to retrieve the property ID, office number, monthly rent, square footage, and owners last name for every property in the PROPERTY_OWNERS view with a monthly rent of less than $1675.
c. Write and execute the query that the DBMS actually executes.
d. Does updating the database through this view create any problems? If so, what are they? If not, why not?
Click or tap here to enter text.
3. Create a view named MONTHLY_RENTS. It consists of two columns: the first is the number of bedrooms, and the second is the average monthly rent for all properties in the PROPERTY table that have that number of bedrooms. Use AVERAGE_RENT as the column name for the average monthly rent. Group and order the rows by number of bedrooms.
a. Write and execute the CREATE VIEW command to create the MONTHLY_RENTS view.
b. Write and execute the command to retrieve the number of bedrooms and average monthly rent for each row for which the average monthly rent is greater than $1,100.
c. Write and execute the query that the DBMS actually executes.
d. Does updating the database through this view create any problems? If so, what are they? If not, why not?
Click or tap here to enter text.
4. Create the following indexes:
a. Create an index named OWNER_INDEX1 on the STATE column in the OWNER table.
b. Create an index named OWNER_INDEX2 on the LAST_NAME column in the OWNER table.
c. Create an index named OWNER_INDEX3 on the STATE and CITY columns in the OWNER table. List the states in descending order.
5. Delete the OWNER_INDEX 3 index from the OWNER table.
6. Add the OWNER_NUM column as a foreign key in the PROPERTY table.
7. Ensure that the only legal values for the BDRMS column in the PROPERTY table are 1,2, or 3.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!