Asked by Anna080
Database Model: StayWell Staywell finds and manages accommodation...
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.
Image transcription text
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.
Image transcription text
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 CO103 Cole Meerab 9486 Circle Ave. Olympia WA 98506 JO110 Jones Ammarah 730 Military Ave. Seattle WA 98126 KO104 Kowalczyk Jakub 7431 S. Bishop St. Bellingham WA 98226 LO108 Lopez Janine 9856 Pumpkin Hill Ln. 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 SI105 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.
Image transcription text
PROPERTY_ID OFFICE NUM ADDRESS SQR_FT BDRMS FLOORS MONTHLY_RENT OWNER_NUM 30 West Thomas Rd. 1600 3 1400 BU106 2 782 Queen Ln. 2100 4 1900 AK102 3 9800 Sunbeam Ave. 1005 2 1200 BI109 4 105 North Illinois Rd. 1750 3 - 1650 KO104 887 Vine Rd. 1125 2 1160 SI105 6 8 Laurel Dr. 2125 4 2 2050 MO100 7 N 447 Goldfield St. 1675 3 1700 CO103 8 N 594 Leatherwood Dr. 2700 5 2750 KO104 9 504 Windsor Ave. 700 2 1050 PA101 10 891 Alton Dr. 1300 3 1600 LO108 11 9531 Sherwood Rd. 1075 2 1100 JO110 12 2 Bow Ridge Ave. 1400 W 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.
Image transcription text
RESIDENT ID FIRST NAME SURNAME PROPERTY ID Albie ODRyan 2 Tariq Khan Ismail Salib 4 Callen Beck 2 5 Milosz Polansky 2 6 Ashanti Lucas 2 7 Randy Woodrue N 8 Aislinn Lawrence 3 9 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.
Image transcription text
SERVICE_ID PROPERTY_ID CATEGORY_NUMBER OFFICE_ID DESCRIPTION STATUS EST_HOURS SPENT_HOURS NEXT_SERVICE_DATE 17 2 2 The second bedroom upstairs is not heating up at night. Problem has been confirmed. central heating 2 2019-11-01 engineer has been scheduled. 2 4 A new strip light is needed for the kitchen. Scheduled 2019-10-02 Service rep has confirmed issue. Scheduled to be 3 6 5 The bathroom door does not close properly. 3 refitted. 2019-11-09 New outlet has been requested for the first upstairs bedroom. 4 N 4 Scheduled 0 2019-10-02 (There is currently no outlet). 5 CO W New paint job requested for the common area (lounge). Open 10 O NULL 6 4 Shower is dripping when not in use. Problem confirmed. Plumber has been scheduled. 4 N 2019-10-07 2 2 Heating unit in the entrance smells like itOs burning. Service rep confirmed the issue to be dust in the 0 2019-10-09 heating unit. To be cleaned. 8 9 N Kitchen sink does not drain properly. Problem confirmed. Plumber scheduled. 6 N 2019-11-12 9 12 6 2 New sofa requested. Open 2 0 NULL
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.
Image transcription text
CATEGORY NUM CATEGORY DESCRIPTION Plumbing 2 Heating 3 Painting 4 Electrical Systems 5 Carpentry 6 Furniture replacement
SERVICE_CATEGORY table
After you have completed a problem and clicked the Run Query button, mark the task as complete. Checks will run to verify your work.
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 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.
Answered by shivalika_gupta
ec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a
m risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. PellentesUnlock full access to Course Hero
Explore over 16 million step-by-step answers from our library
Subscribe to view answers a mol
ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec a
amet, consecte
et, consectetur ad
, dictum vitae odio. Donec al
gue
ipsum d
congue vel laoreet ac, dictum vitae od
et, consectetur adipi
gue
ctum vi
, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing el
s a molestie consequat
pulvinar tortor nec
itur laoreet. Nam risus ante, da
et, consectetur ad
, dictum vitae odio. Donec al
gue
ongue
Donec aliquet. Lorem ipsum dolo
onec aliquet
, dictum vitae odio. Donec aliquet. Lorem ip
e vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec fac
a. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia p
gue
nec facilisis. Pellentesque dapibus
gue
ec fac
Donec aliquet. Lorem ipsum dolo
onec aliquet
sque dapibus efficitur laoreet. Nam
usce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor si
s ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus, congue vel laoreet ac, d
ce dui lectus, congue vel laoreet ac
gue
fficitu
sque dapibus efficitur laoreet.
Donec aliquet. Lorem ipsum d
ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia
gue
trices ac magna. Fusce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pellentesque dapibus efficitur laore
gue
acinia
sus ante, dapibus a molestie consequat, ultrices ac mag
amet, consecte
et, consectetur ad
rem ipsum dolor sit amet, c
, consectetur adipiscing el
usce dui lectus, congue vel la
ipiscing elit. Nam lacinia pulvinar tortor ne
gue
Fusce
sus ante, dapibus a molestie consequat, ultrices ac mag
amet, consecte
et, consectetur ad
rem ipsum dolor sit amet, c
, consectetur adipiscing el
usce dui lectus, congue vel la
sus ante, dapibus a molestie consequat, ultrices ac magna. Fu
gue
consect
ia pulvinar tortor nec facilisis. Pellentesque
amet, consecte
et, consectetur ad
rem ipsum dolor sit amet, c
iscing elit. Nam lacinia pulvinar t
gue
molestie
ia pulvinar tortor nec facilisis. Pellentesque
amet, consecte
et, consectetur ad
rem ipsum dolor sit amet, c
onec aliquet. Lorem ipsum dolor sit
o. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec facilisis. Pelle
gue
icitur l
ia pulvinar tortor nec facilisis. Pellentesque
amet, consecte
et, consectetur ad
rem ipsum dolor sit amet, c
itur laoreet. Nam risus ante, dapibus
or nec facilisis. Pellentesque dapibus efficitur laoreet. Nam risus ante, dapibus a mol
gue
icitur l
s ante, dapibus a molestie consequa
ipiscing elit. Nam lacinia pulvinar tortor nec f
dictum vitae odio. Donec aliquet. Lor
at, ultrices ac magna. Fus
congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur
gue
amet, c
entesque dapibus efficitur laoreet. Nam
a molestie consequat, ultrices ac magna. Fu
m risus ante, dapibus a molestie
usce dui lectus, congue vel
gue
m ipsum
itur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus,
s a molestie consequat
, ultrices ac magna. Fus
onec aliquet. Lorem ipsum do
s a molestie consequat, ult
gue
, dictum
itur laoreet. Nam risus ante, dapibus a molestie consequat, ultrices ac magna. Fusce dui lectus,
s a molestie consequat
, ultrices ac magna. Fus
rem ipsum dolor sit amet, cons
gue
o. Donec aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam lacinia pulvinar tortor nec f