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
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