Question
How would I make this count the number of Sig's in SQL? Here is my code so far. The question is: Compare all six digit
How would I make this count the number of Sig's in SQL? Here is my code so far. The question is:
Compare all six digit industries in 2012 for Nebraska. Count how many are both statistically significant and have higher than expected employment in Nebraska?
SELECT CASE WHEN ((StateData.ExpEmpValue/NationalData.ExpEmpValue)-StateWeights.Employment) > 0 THEN 1 ELSE 0 END AS AboveExp,StateData.StateShort AS state, StateData.IndustryCode AS industry, StateData.DataYear AS year, Sig.YesSig AS sig FROM StateData JOIN NationalData ON StateData.IndustryCode=NationalData.IndustryCode AND BinLower IS NULL AND BinHigher IS NULL AND StateData.DataYear=NationalData.DataYear JOIN StateWeights ON StateData.StateShort=StateWeights.StateShort AND StateData.DataYear=StateWeights.DataYear LEFT JOIN Sig ON StateData.IndustryCode=Sig.IndustryCode AND StateData.DataYear=Sig.DataYear AND Sig.YesSig=1 WHERE StateData.IndustryCodeLength=6 AND StateData.DataYear=2012 AND StateData.StateShort='ne'
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