Question: 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/TotalStateEmp.TotalEmp)*Gamma.Gamma) AS WA FROM StateData JOIN (SELECT

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/TotalStateEmp.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.IndustryCodeLength=6) AS mytable GROUP BY mytable.state, mytable.year

Above is the average level of agglomeration by state in 2012.

How would I change the code to find the average level of Competitiveness (HHI)?

This is in SQL.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!