Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

SERVICE_ID PROPERTY_ID CATEGORY_NUMBER OFFICE_ID DESCRIPTION STATUS EST_HOURS SPENT_HOURS NEXT_SERVICE_DATE Problem has been confirmed. The second bedroom upstairs is not heating up at night. 1 11 2...

1 answer below »

The StayWell maintenance team wants to minimize the number of planned visits to properties. The team wants to learn all the properties that have different planned service dates. You need to return all available data in the SERVICE_REQUEST table, where requests are made for the same property with a different NEXT_SERVICE_DATE.

Return a list of all properties where service requests are made with different NEXT_SERVICE_DATE values.

SERVICE_ID PROPERTY_ID CATEGORY_NUMBER OFFICE_ID DESCRIPTION
STATUS
EST_HOURS SPENT_HOURS NEXT_SERVICE_DATE
Problem has been confirmed.
The second bedroom upstairs is not
heating up at night.
1
11
2
central heating engineer has been
1
 XXXXXXXXXX
scheduled.
2
1
4
1
A new strip light is needed for the kitchen. Scheduled
1
 XXXXXXXXXX
The bathroom door does not close
Service rep has confirmed issue.
6.
1
 XXXXXXXXXX
properly.
Scheduled to be refitted.
New outlet has been requested for the
first upstairs bedroom. (There is currently
no outlet).
4
1
Scheduled
 XXXXXXXXXX
New paint job requested for the common
area (lounge).
5
3
2
Оpen
10
NULL
Problem confirmed. Plumber has
4
1
1
Shower is dripping when not in use.
4
2
 XXXXXXXXXX
been scheduled.
00
4.
Extracted text: SERVICE_ID PROPERTY_ID CATEGORY_NUMBER OFFICE_ID DESCRIPTION STATUS EST_HOURS SPENT_HOURS NEXT_SERVICE_DATE Problem has been confirmed. The second bedroom upstairs is not heating up at night. 1 11 2 central heating engineer has been 1 XXXXXXXXXX scheduled. 2 1 4 1 A new strip light is needed for the kitchen. Scheduled 1 XXXXXXXXXX The bathroom door does not close Service rep has confirmed issue. 6. 1 XXXXXXXXXX properly. Scheduled to be refitted. New outlet has been requested for the first upstairs bedroom. (There is currently no outlet). 4 1 Scheduled XXXXXXXXXX New paint job requested for the common area (lounge). 5 3 2 Оpen 10 NULL Problem confirmed. Plumber has 4 1 1 Shower is dripping when not in use. 4 2 XXXXXXXXXX been scheduled. 00 4.
Answered 47 days After Jun 05, 2022

Solution

Aditi answered on Jul 22 2022
95 Votes
SQL QUERY
SELECT * FROM (SELECT * FROM SERVICE_REQUEST WHERE PROPERTY_ID IN (SELECT PROPERTY_ID FROM SERVICE_REQUEST GROUP BY PROPERTY_ID HAVING COUNT(*)>1)) GROUP BY NEXT_SERVICE_DATE;
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here