SERVICE_ID PROPERTY_ID CATEGORY_NUMBER OFFICE_ID DESCRIPTION STATUS EST_HOURS SPENT_HOURS NEXT_SERVICE_DATE 1 11 2 2 The second bedroom upstairs is not heating up at night. Problem has been confirmed. central heating engineer has been scheduled. 2 1 2019-11-01 2 1 4 1 A new strip light is needed for the kitchen. Scheduled 1 0 2019-10-02 3 6 5 1 The bathroom door does not close properly. Service rep has confirmed issue. Scheduled to be refitted. 3 1 2019-11-09 4 2 4 1 New outlet has been requested for the first upstairs bedroom. (There is currently no outlet). Scheduled 1 0 2019-10-02 5 8 3 2 New paint job requested for the common area (lounge). Open 10 0 NULL 6 4 1 1 Shower is dripping when not in use. Problem confirmed. Plumber has been scheduled. 4 2 2019-10-07 7 2 2 1 Heating unit in the entrance smells like it’s burning. Service rep confirmed the issue to be dust in the heating unit. To be cleaned. 1 0 2019-10-09 8 9 1 2 Kitchen sink does not drain properly. Problem confirmed. Plumber scheduled. 6 2 2019-11-12 9 12 6 2 New sofa requested. Open 2 0 NULL StayWell’s finance department wants to calculate the number of spent hours on each category of services. They require this data to calculate the payments to each service team. You need to collect this information from all the service requests in the database. Output two columns, the category number as CATEGORY_NUMBER, and the spent hours as HOURS_SPENT. Calculate the number of hours spent on each category of services. Expected Results CATEGORY_NUMBER HOURS_SPENT 2 1 4 0 5 1 3 0 1 4 6 0 I need the SQL Command

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
SERVICE_ID PROPERTY_ID CATEGORY_NUMBER OFFICE_ID DESCRIPTION STATUS EST_HOURS SPENT_HOURS NEXT_SERVICE_DATE
1 11 2 2 The second bedroom upstairs is not heating up at night. Problem has been confirmed. central heating engineer has been scheduled. 2 1 2019-11-01
2 1 4 1 A new strip light is needed for the kitchen. Scheduled 1 0 2019-10-02
3 6 5 1 The bathroom door does not close properly. Service rep has confirmed issue. Scheduled to be refitted. 3 1 2019-11-09
4 2 4 1 New outlet has been requested for the first upstairs bedroom. (There is currently no outlet). Scheduled 1 0 2019-10-02
5 8 3 2 New paint job requested for the common area (lounge). Open 10 0 NULL
6 4 1 1 Shower is dripping when not in use. Problem confirmed. Plumber has been scheduled. 4 2 2019-10-07
7 2 2 1 Heating unit in the entrance smells like it’s burning. Service rep confirmed the issue to be dust in the heating unit. To be cleaned. 1 0 2019-10-09
8 9 1 2 Kitchen sink does not drain properly. Problem confirmed. Plumber scheduled. 6 2 2019-11-12
9 12 6 2 New sofa requested. Open 2 0 NULL

StayWell’s finance department wants to calculate the number of spent hours on each category of services. They require this data to calculate the payments to each service team. You need to collect this information from all the service requests in the database. Output two columns, the category number as CATEGORY_NUMBER, and the spent hours as HOURS_SPENT.

Calculate the number of hours spent on each category of services.

Expected Results

CATEGORY_NUMBER HOURS_SPENT
2 1
4 0
5 1
3 0
1 4
6 0

I need the SQL Commands

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Procedures in SQL
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education