Question: Using this as a reference, what code would I use to answer these questions? What is the weighed average level of competitiveness (HHI) by state
Using this as a reference, what code would I use to answer these questions?
What is the weighed average level of competitiveness (HHI) by state in 2012?
What is least competitive state (highest number - state two letter short name)?
What is the weighted average level of agglomeration (7) by state in 2012? SELECT SUM(mytable.WA) AS weightedAverage, mytable.state AS state, mytable.year As year FROM SELECT StateData.Stateshort AS state, StateData.DataYear As year, ((StateData.ExpEmpValue/Totalstate Emp. TotalEmp) *Gamma. Gamma) AS WA FROM StateData JOIN SELECT SUM(StateData.ExpEmpValue) AS TotalEmp, StateData.StateShort AS state FROM StateData WHERE StateData.DataYear=2012 AND StateData. IndustryCodeLength=6 GROUP BY StateData.Stateshort ) AS TotalstateEmp ON StateData.Stateshort-TotalStateEmp.state JOIN Gamma ON Gamma. IndustryCode=StateData. IndustryCode AND Gamma.DataYear=StateData.DataYear WHERE StateData.DataYear=2012 AND StateData. Industry CodeLength=6 ) AS mytable GROUP BY mytable.state, mytable.year What is the weighted average level of agglomeration (7) by state in 2012? SELECT SUM(mytable.WA) AS weightedAverage, mytable.state AS state, mytable.year As year FROM SELECT StateData.Stateshort AS state, StateData.DataYear As year, ((StateData.ExpEmpValue/Totalstate Emp. TotalEmp) *Gamma. Gamma) AS WA FROM StateData JOIN SELECT SUM(StateData.ExpEmpValue) AS TotalEmp, StateData.StateShort AS state FROM StateData WHERE StateData.DataYear=2012 AND StateData. IndustryCodeLength=6 GROUP BY StateData.Stateshort ) AS TotalstateEmp ON StateData.Stateshort-TotalStateEmp.state JOIN Gamma ON Gamma. IndustryCode=StateData. IndustryCode AND Gamma.DataYear=StateData.DataYear WHERE StateData.DataYear=2012 AND StateData. Industry CodeLength=6 ) AS mytable GROUP BY mytable.state, mytable.year
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
