Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

2nd Edition

0471180742, 978-0471180746

More Books

Students also viewed these Databases questions

Question

1. Describe the factors that lead to productive conflict

Answered: 1 week ago