Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This question is for SQL . The below SQL code generates a report of all the car models put in the assigned states within the
This question is for SQL
The below SQL code generates a report of all the car models put in the assigned states within the last day.
Could you please help modify the below SQL code to also include the names of the models tied to each state?
SELECT
'UNSCHEDULEDMAINT' AS STATE, COUNT AS ModelsCount
FROM
Models List
WHERE
state in 'UNSCHEDULEDMAINT'
AND downdate CURRENTDATE INTERVAL day
UNION ALL
SELECT
'SCHEDULEDMAINT' AS STATE, COUNT AS ModelsCount
FROM
Models List
WHERE
state in 'SCHEDULEDMAINT'
AND downdate CURRENTDATE INTERVAL day
UNION ALL
SELECT
'Running' AS state,
COUNT AS Modelscount
FROM
Models List
WHERE
state 'Running'
AND downdate CURRENTDATE INTERVAL day;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started