Question: I need to create a subquery and join in Mysql workbench. Use query from Step 9 as a subquery and join it to the demographics
I need to create a subquery and join in Mysql workbench.
Use query from Step 9 as a subquery and join it to the demographics table using the following case statement:
demographics.age =
case
when temp_pop.age < 18 then '00 to 17'
when temp_pop.age > 64 then '65 to 80+'
else '18 to 64'
end
temp_pop is an alias for the subquery. Use the following calculation for the demand output:
round(sum(temp_pop.total_pop * demographics.coefficient)) as demand
Output the demand grouped by year and education level.
Step 9 query:
select year, age, pop_total from pop_proj
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
