Question: SQL Database Model: StayWell Staywell finds and manages accommodation for owners of student accommodation in the Seattle Area. The company rents out and helps to

 SQL Database Model: StayWell Staywell finds and manages accommodation for owners

of student accommodation in the Seattle Area. The company rents out and

helps to maintain 1-5-bedroom properties located in two main areas in the

city, Columbia City and Georgetown. This is done on behalf of property

owners based both in the local area and throughout the United States.

Each location is administrated by a different office, StayWell-Columbia City and StayWell-

Georgetown. Staywell wishes to expand its business. The current model relies on

advertisements in student and university publications in print and online, but prospective

owners and renters need to contact the offices and speak to an

administrator on all matters relating to renting of properties. The office organizes

maintenance services for a fee, which is also currently done via email

SQL

Database Model: StayWell Staywell finds and manages accommodation for owners of student accommodation in the Seattle Area. The company rents out and helps to maintain 1-5-bedroom properties located in two main areas in the city, Columbia City and Georgetown. This is done on behalf of property owners based both in the local area and throughout the United States. Each location is administrated by a different office, StayWell-Columbia City and StayWell- Georgetown. Staywell wishes to expand its business. The current model relies on advertisements in student and university publications in print and online, but prospective owners and renters need to contact the offices and speak to an administrator on all matters relating to renting of properties. The office organizes maintenance services for a fee, which is also currently done via email or direct communication. StayWell has decided that the best way to increase efficiency and move toward an e- commerce-based business model is to store all the data about the properties, owners, tenants and services in databases. This will mean that the information can be easily accessed. StayWell hopes that these databases can then be used in future projects such as mobile apps and online booking systems. The data is split into several tables, shown below: The OFFICE table shows the office number, office name, address, area, city, state, and ZIP code. OFFICE_NUM OFFICE NAME ADDRESS AREA CITY STATE ZIP CODE 1 Staywell.Columbia City 1135 N. Wells Avenue Columbia City Seattle WA 98118 2. Staywell-Georgetown 986 S. Madison Rd Georgetown Seattle WA 98108 OFFICE table StayWell stores information about the owners of each property in the OWNER table. Each owner is identified by a unique owner number that consists of two uppercase letters followed by a three-digit number. For each owner, the table also includes the last name, first name, address, city, state, and ZIP code. Notice the owners are from across the United States. Although some apartments may be owned by a couple or a family, only the primary contact is given. OWNER NUM LAST NAME FIRST NAME ADDRESS CITY STATE ZIP CODE AK102 Aksoy Ceyda 411 Griffin Rd Seattle WA 98131 BI109 Bianchi Nicole 7990 Willow Dr. New York NY 10005 BU106 Burke Ernest 613 Old Pleasant St. Twin Falls ID 83303 C0103 Cole Meerab 9486 Circle Ave. Olympia WA 98506 JO110 Jones Ammarah 730 Military Ave Seattle WA 98126 KO104 Kowalczyk Jakub 7431 5. Bishop St. Bellingham WA 98226 LO108 Lopez Janine 9856 Pumpkin Hill in Everett WA 98213 MO100 Moore Elle-May 8006 W. Newport Ave. Reno NV 89508 PA101 Patel Makesh 7337 Sheffield St. Seattle WA 98119 RE107 Redman Seth 7681 Fordham St. Seattle WA 98119 S1105 Sims Haydon 527 Primrose Rd Portland OR 97203 OWNER table Each property at each location is identified by a property ID, as seen in the PROPERTY table. Each property also includes the office number that manages the property, address, floor size, the number of bedrooms, the number of floors, monthly rent per property, and the owner number. The PROPERTY_ID is an integer unique for each property. PROPERTY ID OFFICE NUM ADDRESS SOR FT BORMS FLOORS MONTHLY RENT OWNER NUM 1 1 30 West Thomas Rdi 1600 3 1 1400 BU106 2 1 1 782 Queen in 2100 4 2 1900 AK102 3 1 9800 Sunbeam Ave. 1005 2 1200 B1109 4 1 105 North Illinois Rd. 1750 3 1 1650 KO104 5 887 Vine Rd 1125 2 1 1160 SI105 6 1 8 Laurel Dr. 2125 4 2 2050 MO100 7 2 447 Goldfield St. 1675 3 2 1700 CO103 S 2 594 Leatherwood Dr. 2700 5 2 2750 KO104 9 2 700 2 1 1 1050 PA101 504 Windsor Ave 891 Alton Dr. 10 2 1300 3 1 1600 LO108 10 2 9531 Sherwood Rd. 1075 2 1 1100 JO110 12 2 2 Bow Ridge Ave. 1400 3 2 1700 RE107 PROPERTY table The RESIDENTS table includes details about the residents living in each property. The RESIDENTS table includes the first name and surname (last name) for each of the residents, along with a resident ID. The PROPERTY_ID is the unique identification number of the property in which they are staying. RESIDENT ID FIRST NAME SURNAME PROPERTY ID 1 Albie ODRyan 1 2 Tariq Khan 1 3 Ismail Salib 1 4 Callen Beck 2 5 Milosz Polansky 2 6 Ashanti Lucas 2 Randy Woodrue 2 8 Aislinn Lawrence 3 Monique French 3 10 Amara Dejsuwan 4 RESIDENTS table The SERVICE_REQUEST table shows requests that residents have put into the offices for maintenance. Each row contains a unique service ID number, the property ID, the category number associated with the type of work, the office managing the property, a description of the request, the current status of the request, the estimated hours to complete the request, the hours spent on the request, and the scheduled service date. SERVICE D PROPERTY ID CATEGORY NUMBER OFFICE ID DESCRIPTION STATUS EST HOURS SPENT HOURS NEXT SERVICE DATE 2 2 2 The second bedroom upstairs is not heating up at night Problern has been confirmed central heating engineer has been scheduled 2019-11-01 2 1 4 1 1 Scheduled 0 A new strip light is needed for the kitchen 2019-10-02 3 Service rep has confirmed issue Scheduled to be refitted The bathroom door does not close properly 3 2015-11-09 2 1 1 0 New outlet has been requested for the first upstairs bedroom (There is currently no outlet Scheduled 2019-10-02 0 10 3 5 NULL 2 Open New paint job requested for the common area (ounge) 4 6 2 1 A 2019-10-07 1 Problem confirmed, Plumber has been scheduled. Shower is dripping when not in use 2 1 0 2019-10-09 Service rep confirmed the issue to be dust in the heating unit. To be deaned 2 1 Heating unit in the entrance smells like its burning, 9 2019-11-12 3 6 1 1 2 2 Problem confirmed Plumber scheduled Kitchen Sink does not drain properly NULL 12 2 2 New sala requested. Open SERVICE REQUEST table The SERVICE CATEGORY table includes details of these services. The CATEGORY_NUM provides a unique number for the service, and CATEGORY_DESCRIPTION stores a description of what the service is. CATEGORY_NUM CATEGORY DESCRIPTION 1 Plumbing 2 Heating 3 Painting 4 Electrical Systems 5 Carpentry 6 Furniture replacement SERVICE CATEGORY table Grading After you have completed a problem and clicked the Run Query button, mark the task as complete. Checks will run to verify your work. Tasks Task 1: For every property, list the management office number, address, monthly rent, owner number, owner's first name, and owner's last name. Task 2: For every completed or open service request, list the property ID, description, and status. Task 3: For every service request for janitorial work, list the property ID, management office number, address, estimated hours, spent hours, owner number, and owner's last name. Task 4: List the first and last names of all owners who own a two-bedroom property. Use the IN operator in your query. Task 5: Repeat Task 4, but this time use the EXISTS operator in your query. Task 6: List the property IDs of any pair of properties that have the same number of bedrooms. For example, one pair would be property ID 2 and property ID 6, because they both have four bedrooms. The first property ID listed should be the major sort key and the second property ID should be the minor sort key. Task 7: List the square footage, owner number, owner last name, and owner first name for each property managed by the StayWell-Columbia City office. Task 8: Repeat Task 7, but this time include only those properties with three bedrooms Task 9: List the office number, address, and monthly rent for properties whose owners live in Washington State or own two-bedroom properties. Task 10: List the office number, address, and monthly rent for properties whose owners live in Washington State and own a two-bedroom property. Task 11: List the office number, address, and monthly rent for properties whose owners live in Washington State but do not own two-bedroom properties. ] Task 12: Find the service ID and property ID for each service request whose estimated hours is greater than the number of estimated hours of any service request with category number 5. ) Task 13: Find the service ID and property ID for each service request whose estimated hours is greater than the number of estimated hours on all service requests on which the category number is 5. ] Task 14: List the address, square footage, owner number, service ID, number of estimated hours, and number of spent hours for each service request on which the category number is 4. Task 14: List the address, square footage, owner number, service ID, number of estimated hours, and number of spent hours for each service request on which the category number is 4. ] Task 15: Repeat Task 14, but this time be sure each property is included regardless of whether it currently has any service requests for category 4

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 Databases Questions!