Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1) Using either median() or percentile_cont() functions, determine the median of the percent change in county population Here is the code I have to show
1) Using either median() or percentile_cont() functions, determine the median of the percent change in county population
Here is the code I have to show the percentage change from 2000 to 2010. I need help figuring out how to capture the median for the column pct_change
Here is what the sample data looks like from the tables, for example US Counties 2010 (same columns as 2000).
geo_name | state_us_abbreviation | summary_level | region | division | state_fips | county_fips | area_land | area_water | population_count_100_percent | housing_unit_count_100_percent | internal_point_lat | internal_point_lon | p0010001 | p0010002 | p0010003 | p0010004 |
Autauga County | AL | 50 | 3 | 6 | 1 | 1 | 1.54E+09 | 25775735 | 54571 | 22135 | 32.53638 | -86.6445 | 54571 | 53702 | 42855 | 9643 |
Baldwin County | AL | 50 | 3 | 6 | 1 | 3 | 4.12E+09 | 1.13E+09 | 182265 | 104061 | 30.65922 | -87.7461 | 182265 | 179542 | 156153 | 17105 |
Barbour County | AL | 50 | 3 | 6 | 1 | 5 | 2.29E+09 | 50864716 | 27457 | 11829 | 31.87067 | -85.4055 | 27457 | 27199 | 13180 | 12875 |
Where p0010001 is total population
1 SELECT c2010.geo_name, c2010.state_us_abbreviation AS state, c2010.p0010001 AS pop_2010, c2000.p0010001 AS pop_2000, c2010.p0010001 - c2000.p0010001 AS raw_change, round (CAST (c2010.p0010001 AS numeric(8,1)) - c2000.p0010001)/ c2000.p0010001100, 1 AS pct_change 4 7 FROM us_counties_2010 c2010 INNER JOIN us_counties_2000 c2000 8 ON c2010.state_fipsc2000.state_fips AND c2010.county_fips c2000.county_fips AND c2010.po010001 C2000.p0010001 10 11 ORDER BY pct_change DESC; Data Output Explain Messages Notifications state geo_name character varying (90) pop_2010 pop 2000 raw_change pct change integer character varying (2) integer integer numeriC 1 Kendall County 2 Pinal County 3 Flagler County 4 Lincoln County 5 Loudoun County 6 Rockwall County AZ FL SD VA TX 114736 375770 95696 44828 312311 78337 175511 54544 179727 49832 24131 169599 43080 60192 196043 45864 20697 142712 35257 77 1 110.4 109.1 92.0 85.8 84.1 81.8 Forsvth CountvStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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