text: /* WEATHER OBSERVATION STATION 20 */
  /*
  A median is defined as a number separating the higher half of a data set from the lower half. 
  Query the median of the Northern Latitudes (LAT_N) from STATION and round your answer to 4 decimal places.
  Note: Oracle solutions are not permitted for this challenge.
  
  select '(' + convert(varchar(10),ID) + ",'" + City + "','" + State + "'," + Convert(varchar(20),Lat_N) + "," + + Convert(varchar(20),LONG_W) + "),"  from Station Order by 1 
  */
  declare @Station Table (ID int, City Varchar(22), State Varchar(2), Lat_N float, Long_W float)
  insert into @Station Values (1,'Pfeifer','KS',37.4447804700,65.6849125200), (3,'Hesperia','CA',106.0569286000,71.1187671100), (4,'South Britain','CT',65.5842193100,33.6050437900), (11,'Crescent City','FL',58.0396424800,117.9040740000), 
  (14,'Forest','MS',120.2830760000,50.2288335600), (15,'Ducor','CA',140.8633607000,102.0393390000), (16,'Beaufort','MO',71.7741806400,85.6574183800), (17,'Fredericktown','MO',105.5334784000,112.6890911000), (23,'Honolulu','HI',110.1019550000,139.7437776000), 
  (25,'New Century','KS',135.0165273000,79.2737078000), (26,'Church Creek','MD',39.4314815700,91.2580912600), (29,'South Carrollton','KY',57.9964652400,116.9612554000), (31,'Novinger','MO',108.0363353000,111.9051940000), (33,'Saint Elmo','AL',27.3469862700,50.5795036500), 
  (34,'Mcbrides','MI',74.0570840300,35.6824854200), (35,'Richmond Hill','GA',39.3962580300,113.5962389000), (44,'Kismet','KS',99.8225276600,156.5035829000), (45,'Rives Junction','MI',94.1975092200,116.8527277000), 
  (49,'Osborne','KS',70.3616832700,139.7111654000), (53,'Shasta','CA',99.3217648000,155.6064309000), (55,'Coalgood','KY',57.1709310600,149.0199479000), (57,'Clifton','AZ',30.1546389800,135.7025933000), (59,'Whitewater','MO',82.7180974300,71.4260769600), 
  (61,'Brilliant','AL',86.4433245200,159.8521168000), (62,'Monroe','AR',131.9009853000,150.2191899000), (65,'Buffalo Creek','CO',47.6614595800,148.1867300000), (67,'Reeds','MO',30.7888812900,42.5021131100), (69,'Kingsland','AR',78.2248763400,85.1385766700), 
  (70,'Norphlet','AR',144.0236478000,61.1937635200), (76,'Pico Rivera','CA',143.2779102000,116.5329052000), (80,'Bridgton','ME',93.2257481000,140.4154640000), (81,'Cowgill','MO',136.7968514000,27.6443786900), (82,'Many','LA',36.2798914400,94.7304909900), 
  (84,'Cobalt','CT',87.3206559300,26.5320314800), (88,'Eros','LA',95.1626417200,58.3134903300), (92,'Watkins','CO',83.2743306300,96.7373230500), (93,'Dale','IN',69.5933502200,34.4155211900), (95,'Dupo','IL',41.2834229700,29.0334292900), 
  (96,'Raymondville','MO',70.6823916800,148.4444084000), (98,'Hackleburg','AL',119.5607105000,120.6244819000), (99,'Woodstock Valley','CT',117.3945666000,162.6313182000), (100,'North Monmouth','ME',130.9470284000,78.1720794000), (102,'Kirksville','MO',140.0030631000,143.8709979000), 
  (104,'Yalaha','FL',120.3796720000,119.6867612000), (105,'Weldon','CA',134.0156771000,118.9609382000), (106,'Yuma','AZ',111.3250449000,153.9544591000), (108,'North Berwick','ME',70.8337171900,27.3200413500), (109,'Bridgeport','MI',50.6898811900,79.9013785900), 
  (110,'Mesick','MI',82.1244603600,108.5283528000), (113,'Prescott','IA',39.9323442100,65.7932782300), (116,'Mc Henry','MD',93.2877194600,112.5615175000), (117,'West Grove','IA',127.2347708000,99.4072105400), (119,'Wildie','KY',69.6581298700,111.8552379000), 
  (122,'Robertsdale','AL',97.7213689000,85.3747551000), (124,'Pine City','MN',119.4617792000,129.3654709000), (127,'Oshtemo','MI',100.3702957000,135.9503227000), (130,'Hayneville','AL',109.7380661000,157.4686782000), (136,'Bass Harbor','ME',137.6658892000,61.3250584300), 
  (143,'Renville','MN',142.1513936000,99.4320131300), (144,'Eskridge','KS',107.6258317000,63.4942554800), (154,'Baker','CA',31.0460308400,148.4583053000), (155,'Casco','MI',138.5984073000,109.0728819000), (156,'Heyburn','ID',82.0861119500,121.0459768000), 
  (157,'Blue River','KY',116.9576347000,161.9999536000), (160,'Grosse Pointe','MI',102.0471602000,91.3713112200), (161,'Alanson','MI',90.6531996000,72.1195229700), (162,'Montgomery City','MO',70.4431272600,44.6656582000), (165,'Baileyville','IL',82.2546804300,61.4530581600), 
  (166,'Mccomb','MS',74.0416937600,42.6337468100), (167,'Equality','AL',106.9827016000,116.0551095000), (171,'Springerville','AZ',124.6882036000,150.6628287000), (172,'Atlantic Mine','MI',131.2317773000,99.4668726800), (174,'Onaway','MI',108.6065870000,55.7594569200), 
  (175,'Lydia','LA',41.7823738600,39.5303791900), (176,'Grapevine','AR',92.3658922500,84.5429368600), (180,'Napoleon','IN',32.0332562600,160.2402958000), (181,'Fairview','KS',80.2713355600,164.5798928000), (182,'Winter Park','FL',133.2328303000,32.7552315900), 
  (183,'Jordan','MN',68.7463892800,35.4622850300), (188,'Prairie Du Rocher','IL',75.5769226400,70.7057988100), (189,'West Somerset','KY',73.9692683300,45.0566682800), (190,'Oconee','GA',92.5622072200,119.4774310000), (193,'Corcoran','CA',81.3013730900,139.5642079000), 
  (196,'Compton','IL',106.6179930000,99.4070416200), (197,'Milledgeville','IL',90.9881102800,113.2748504000), (199,'Linden','MI',53.4111621800,32.6242220600), (200,'Franklin','LA',82.2406279400,31.7787272500), (202,'Hope','MN',140.3641688000,43.7290197800), 
  (204,'Alba','MI',91.6374264000,103.6339603000), (207,'Olmitz','KS',29.2389167400,38.4022475400), (208,'Lottie','LA',109.8672979000,82.7665014400), (213,'Calpine','CA',46.5140174400,43.2848995800), (215,'Kensett','IA',55.7229538500,139.5524526000), (218,'Round Pond','ME',127.4428771000,124.0040106000), 
  (223,'Losantville','IN',112.5187171000,106.7760547000), (224,'West Hyannisport','MA',58.9609148600,96.0147584300), (225,'Garden City','IA',54.2096694900,119.9108332000), (226,'Decatur','MS',71.2471424200,117.5656331000), (228,'Rydal','GA',35.6835783800,78.8233734300), (231,'Arispe','IA',31.1114963500,137.7968198000), 
  (232,'Grandville','MI',38.8525623900,70.1377628900), (233,'Pierre Part','LA',52.0854642700,90.0586868000), (234,'Rogers','CT',140.4723914000,33.1833567300), (235,'Haubstadt','IN',27.9889806800,32.0817084200), (237,'Winchester','ID',38.3703344300,80.0549859000), (240,'Saint Paul','KS',66.2139565600,163.0077619000), 
  (241,'Woodsboro','MD',76.6267086600,141.8878169000), (242,'Macy','IN',138.6944770000,152.3694449000), (243,'Hazlehurst','MS',49.0268736600,108.5047274000), (246,'Ludington','MI',30.2216708200,120.2292117000), (249,'Acme','LA',73.1617064700,67.6824777600), (250,'Hampden','MA',76.3907430800,26.4836883800), 
  (252,'Childs','MD',92.7594351000,104.0155475000), (253,'Winsted','MN',68.8238493900,72.5151142200), (255,'Brighton','IL',107.6050821000,32.8488205800), (257,'Eureka Springs','AR',72.0581105200,34.7837926800), (259,'Baldwin','MD',81.7357216500,40.4397386000), (260,'Sizerock','KY',116.0212592000,112.7471971000), 
  (261,'Fulton','KY',111.1099272000,51.9333688000), (263,'Irvington','IL',96.7047424400,68.2871918100), (266,'Cahone','CO',116.2321963000,127.0095540000), (269,'Jack','AL',49.9370302300,85.6281732600), (270,'Shingletown','CA',61.1231699600,102.1004578000), (271,'Hillside','CO',99.2655816400,68.8435268400), 
  (273,'Rosie','AR',72.7589687500,161.9173483000), (278,'Cromwell','MN',128.8462234000,53.5125406100), (283,'Clipper Mills','CA',113.7157379000,56.9534953200), (286,'Five Points','AL',45.6601846900,122.2230485000), (287,'Madisonville','LA',112.2163874000,53.0460361900), (288,'Daleville','AL',121.8865105000,136.1704398000), 
  (291,'Clarkdale','AZ',58.1941729700,73.9478993800), (294,'Orange Park','FL',59.2194907700,137.3062222000), (299,'Goodman','MS',101.4399417000,117.2836453000), (301,'Monona','IA',144.1294884000,81.5780399600), (302,'Saint Petersburg','FL',51.7059963300,119.8633195000), (303,'Cascade','ID',31.7716882800,157.4787824000), 
  (305,'Bennington','KS',93.8672936900,83.2352278100), (306,'Bainbridge','GA',62.0528251500,56.8764458000), (311,'South Haven','MN',30.4998198200,87.1252983500), (312,'Bentonville','AR',36.9528472000,78.0684362800), (315,'Ravenna','KY',79.1546716900,106.2521720000), (321,'Bowdon Junction','GA',85.9317415800,33.6009832100), 
  (322,'White Horse Beach','MA',54.2863686700,59.3248348400), (323,'Barrigada','GU',60.6071647300,147.5296125000), (324,'Norwood','MN',144.4891504000,34.8852933600), (325,'Monument','KS',70.5230095300,141.7680413000), (326,'Rocheport','MO',114.1631590000,64.4821655300), (327,'Ridgway','CO',77.4381808100,110.2668422000), 
  (328,'Monroe','LA',28.3566595600,108.4230828000), (329,'Caseville','MI',102.9200706000,98.4033735000), (331,'Cranks','KY',55.6091110900,27.2847122900), (332,'Elm Grove','LA',45.9437623800,29.4014281400), (336,'Dumont','MN',57.0124315000,129.3675605000), (337,'Mascotte','FL',121.4608708000,146.1675503000), (339,'Kirk','CO',141.0973970000,136.3312671000), 
  (342,'Chignik Lagoon','AK',103.1995264000,153.0084273000), (343,'Mechanic Falls','ME',71.6703701700,71.1221787900), (344,'Zachary','LA',60.7090449400,152.4891268000), (345,'Yoder','IN',83.4994658100,143.7158260000), (350,'Cannonsburg','MI',91.0335166700,120.6696799000), (351,'Fredericksburg','IN',44.5120348900,78.0579773900), 
  (352,'Clutier','IA',61.1888319000,127.0339038000), (354,'Larkspur','CA',107.0529696000,65.9736308300), (355,'Weldona','CO',32.9672720400,58.4491769500), (356,'Ludlow','CA',110.9935346000,87.5889856000), (357,'Yellville','AR',35.6871043400,42.2465866400), (361,'Arrowsmith','IL',28.0031869300,109.3395101000), (362,'Magnolia','MS',112.7433771000,31.7992904000), 
  (363,'Reasnor','IA',41.5971014800,162.5641830000), (364,'Howard Lake','MN',125.7573101000,78.3280770500), (365,'Payson','IL',81.7358139300,92.1148894900), (366,'Norvell','MI',125.3431567000,93.7524586400), (370,'Palm Desert','CA',106.8122401000,145.7556010000), (373,'Pawnee','IL',85.2331891600,81.4161358500), (375,'Culdesac','ID',47.8418268000,78.0655123600), 
  (376,'Gorham','KS',111.3244307000,64.7460158000), (377,'Koleen','IN',137.5485615000,110.5110324000), (378,'Clio','IA',46.1526332400,115.4197768000), (380,'Crane Lake','MN',72.9186996300,43.2169180800), (382,'Leavenworth','IN',100.4326724000,121.7334554000), (383,'Newbury','MA',128.3982315000,85.1747002300), (384,'Amo','IN',103.5871398000,159.4306474000), 
  (387,'Ojai','CA',68.6141099800,119.3268593000), (389,'Midpines','CA',106.4324573000,59.3835860800), (391,'Berryton','KS',60.7268360400,139.7644481000), (392,'Delano','CA',126.3467998000,91.5016174600), (394,'Centertown','MO',133.9733513000,93.1724637400), (396,'Dryden','MI',69.8018252300,47.7436689000), (399,'Republic','MI',75.4218200000,130.1266717000), 
  (400,'New Ross','IN',134.0171278000,120.9457064000), (401,'Tennessee','IL',55.4983811700,155.6455992000), (403,'Zionsville','IN',57.7918146400,36.4938660000), (404,'Farmington','IL',91.7144044000,72.0223174000), (405,'Susanville','CA',128.2498724000,80.3167947500), (406,'Carver','MN',45.8925110400,122.0696810000), (409,'Columbus','GA',67.3389228900,46.6162265300), 
  (410,'Calhoun','KY',95.5960814400,56.9022259300), (411,'Negreet','LA',98.9707194000,105.3376115000), (413,'Linthicum Heights','MD',127.5633635000,67.7255892700), (414,'Manchester','MD',73.5158072400,37.1460286900), (417,'New Liberty','IA',139.9576338000,94.6040215900), (419,'Lindsay','MT',143.1029143000,67.8431593500), (420,'Frankfort Heights','IL',71.6032131300,30.3732749700), 
  (423,'Soldier','KS',77.3005169700,152.6019439000), (426,'Millville','CA',32.5583820900,145.7434609000), (428,'Randall','KS',47.9977280600,135.6275983000), (429,'Lucerne Valley','CA',35.6176342900,48.4057460100), (430,'Rumsey','KY',70.6921152000,50.2122756000), (433,'Canton','ME',98.7303575900,105.9734460000), (435,'Albion','IN',44.2584494400,121.8753316000), 
  (436,'West Hills','CA',68.4303534400,73.0954190500), (438,'Bowdon','GA',88.9811101300,78.4902524100), (439,'Reeves','LA',35.2531060800,51.4005462200), (440,'Grand Terrace','CA',37.3104416700,126.5856106000), (441,'Hanna City','IL',50.9893298700,136.7811010000), (442,'Elkton','MD',103.2547878000,156.7289171000), (444,'Richland','GA',105.4709117000,113.0379774000), 
  (446,'Mid Florida','FL',110.4113429000,50.7513279200), (447,'Arkadelphia','AR',98.6229522800,49.5750114600), (448,'Canton','MN',123.6434525000,151.4217519000), (451,'Fort Atkinson','IA',142.8573871000,140.6362117000), (453,'Sedgwick','AR',68.9333441800,75.2941859500), (455,'Granger','IA',33.4187514900,102.0769844000), (457,'Chester','CA',69.8129509200,123.9310828000), 
  (459,'Harmony','IN',135.0209241000,70.8252002300), (460,'Leakesville','MS',107.1711382000,72.5774059700), (464,'Gales Ferry','CT',104.5686160000,37.4148061000), (465,'Jerome','AZ',121.7110583000,34.4061039700), (467,'Roselawn','IN',87.7070816900,51.7450698600), (470,'Healdsburg','CA',111.0990566000,54.2233926800), (471,'Cape Girardeau','MO',73.5045096700,90.5430944100), 
  (473,'Highwood','IL',27.2544581400,150.9227402000), (474,'Grayslake','IL',61.3037421800,33.0592313100), (476,'Julian','CA',130.5068313000,101.5586762000), (478,'Tipton','IN',33.5479270100,97.9428603600), (479,'Cuba','MO',63.7191611400,87.6484331300), (482,'Jolon','CA',66.6505437800,52.9552876900), (486,'Delta','LA',136.5385281000,49.7308676600), 
  (489,'Madden','MS',81.3422321800,99.3799825700), (492,'Regina','KY',131.5515912000,90.2382629100), (493,'Groveoak','AL',53.3876660700,87.5140443200), (494,'Palatka','FL',94.5452423700,52.3288883500), (495,'Upperco','MD',114.2157413000,29.6310475800), (497,'Hills','MN',137.9673743000,134.7732604000), (498,'Glen Carbon','IL',60.8365036000,140.7226054000), 
  (499,'Delavan','MN',32.5776660800,64.5136694400), (501,'Tefft','IN',93.2152707400,150.0159946000), (502,'Bellevue','KY',127.4330424000,121.7488466000), (503,'Northfield','MN',61.0020777500,37.1533552200), (504,'Melber','KY',37.2488485400,55.5333515900), (505,'Williams','AZ',73.4810091300,111.7413889000), (506,'Firebrick','KY',49.9918393400,95.0390071200), 
  (510,'Eastlake','MI',134.0938535000,38.7821291300), (512,'Garland','ME',108.7311062000,134.3750565000), (515,'Waresboro','GA',144.2468197000,153.6063421000), (518,'Vulcan','MO',108.6087788000,91.5613894400), (519,'Rio Oso','CA',29.3905237800,105.8220992000), (520,'Delray Beach','FL',27.2867514100,158.5234960000), (521,'Gowrie','IA',130.2024387000,127.9825354000), 
  (522,'Harmony','MN',124.3596204000,126.3744558000), (524,'Montrose','CA',136.4765033000,119.3735580000), (526,'Tarzana','CA',135.8603987000,81.3073130300), (527,'Auburn','IA',95.4892694900,137.0748386000), (528,'Crouseville','ME',36.5185121000,81.5448162400), (531,'North Middletown','KY',42.9881136400,141.9110269000), (536,'Henderson','IA',77.9241724900,77.9066287600), 
  (537,'Hagatna','GU',97.1732158400,151.8086289000), (538,'Cheswold','DE',31.9374373300,59.3468951900), (539,'Montreal','MO',129.2453575000,127.3259318000), (540,'Mosca','CO',89.2044133500,141.4811419000), (541,'Siloam','GA',105.0197648000,92.2343791700), (543,'Lapeer','MI',128.6213550000,114.2603286000), (545,'Byron','CA',136.5105235000,120.4150088000), 
  (547,'Sandborn','IN',55.9468076700,93.8531547500), (551,'San Simeon','CA',37.5328728800,28.3416720400), (554,'Brownsdale','MN',52.4264666400,50.7983630400), (555,'Westphalia','MI',32.7664163700,143.8050085000), (557,'Woodbury','GA',102.5472386000,93.3755393200), (560,'Osage City','KS',110.2040149000,89.6074362700), (566,'Marine On Saint Croix','MN',126.1597844000,115.7915363000), 
  (570,'Greenview','CA',80.5000041200,57.5880040400), (571,'Tyler','MN',133.3521233000,58.6327383300), (572,'Athens','IN',75.3210400800,120.7983748000), (573,'Alton','MO',79.7827776200,112.0377817000), (581,'Carlos','MN',114.9060173000,66.2810487000), (582,'Curdsville','KY',84.7874901200,150.4842247000), (583,'Channing','MI',117.1645417000,56.9512447800), (586,'Ottertail','MN',100.0240382000,44.3416548100), 
  (588,'Glencoe','KY',46.3873924400,136.0427027000), (591,'Baton Rouge','LA',129.8353108000,71.7507484800), (593,'Aliso Viejo','CA',67.5164188500,131.4169084000), (595,'Grimes','IA',42.0501962300,74.7331491300), (596,'Brownstown','IL',48.6521881100,63.2209572300), (598,'Middleboro','MA',108.0489233000,149.2884231000), (599,'Esmond','IL',75.5544247100,90.9238071900), 
  (600,'Shreveport','LA',136.2310159000,38.5020729100), (603,'Sandy Hook','CT',72.3374801400,148.2400769000), (604,'Forest Lakes','AZ',144.8428773000,114.2941167000), (605,'Notasulga','AL',66.8442632200,115.6864036000), (606,'Morenci','AZ',104.8964262000,110.2033978000), (608,'Busby','MT',104.0894472000,29.8303510900), (609,'Marysville','MI',85.7613473100,132.8724084000), 
  (610,'Archie','MO',40.2010732600,28.2044907200), (611,'Richmond','IL',113.2485902000,163.4569608000), (612,'Sturdivant','MO',93.8407629800,86.3885095500), (613,'East China','MI',108.6868178000,42.4811130000), (614,'Benedict','KS',138.4990456000,95.7197896900), (615,'Libertytown','MD',144.5783185000,111.9744225000), (617,'Sturgis','MS',36.4567351700,126.1690696000), 
  (619,'Arlington','CO',75.1799307900,92.9461589400), (621,'Flowood','MS',64.8887703500,149.2064111000), (623,'Jackson','AL',111.2337497000,67.2351278300), (624,'Knobel','AR',95.3541657500,62.0905643200), (625,'Bristol','ME',87.9680741400,95.2885000600), (630,'Prince Frederick','MD',104.8277251000,57.7240982400), (631,'Urbana','IA',142.5259070000,29.3535608000), 
  (633,'Bertha','MN',39.9488902800,105.3111577000), (636,'Ukiah','CA',86.9807406500,89.5821511900), (637,'Beverly','KY',57.7545009400,126.8958422000), (638,'Clovis','CA',92.4396529900,138.0751933000), (640,'Walnut','MS',40.9363282600,76.9615994200), (642,'Lynnville','KY',25.4083603100,146.4916272000), (643,'Wellington','KY',100.4511347000,31.6876083500), 
  (644,'Seward','AK',120.2916666000,35.7096209300), (646,'Greens Fork','IN',133.9202472000,135.4831973000), (647,'Portland','AR',83.9211681800,44.8055569400), (649,'Pengilly','MN',25.0735260600,154.0642918000), (650,'Clancy','MT',45.8299685400,164.3786750000), (651,'Clopton','AL',40.7710435800,84.7067833900), (654,'Lee','IL',27.6719423600,51.0091607300), (656,'Pattonsburg','MO',138.1003340000,32.1080402400), 
  (657,'Gridley','KS',118.1450367000,55.8017845400), (661,'Payson','AZ',126.3006665000,154.1581522000), (662,'Skanee','MI',70.1724149000,129.5593113000), (665,'Chelsea','IA',98.7221093700,59.6891300200), (666,'West Baden Springs','IN',30.3479685800,96.1092558100), (667,'Hawarden','IA',90.9616154500,46.9325560200), (668,'Rockton','IL',116.1223935000,86.8383300400), (672,'Lismore','MN',58.8714297100,103.8693391000), 
  (673,'Showell','MD',44.1885821900,163.5375464000), (675,'Dent','MN',70.7499889500,136.7844469000), (677,'Hayesville','IA',119.9881564000,42.1271934900), (678,'Bennington','IN',35.5210732100,26.8036220700), (679,'Gretna','LA',75.2629378700,142.5762285000), (682,'Pheba','MS',90.9456098800,127.3003694000), (684,'Mineral Point','MO',91.1983162500,41.4298014200), (685,'Anthony','KS',45.0053660100,161.1266931000), 
  (690,'Ravenden Springs','AR',67.6283806100,108.2637595000), (692,'Yellow Pine','ID',83.1225728600,150.8949096000), (694,'Ozona','FL',144.9890627000,120.8800876000), (695,'Amazonia','MO',45.7856630400,148.2013846000), (696,'Chilhowee','MO',79.6079445700,49.3575049400), (698,'Albany','CA',49.7511276500,80.2121131700), (699,'North Branford','CT',37.7992448800,95.2709737500), (700,'Pleasant Grove','AR',135.1358062000,145.5898330000), 
  (701,'Seaton','IL',128.2287955000,78.4300562800), (702,'Everton','MO',119.0469849000,51.4851296700), (704,'Climax','MI',127.3563782000,107.0542747000), (705,'Hotchkiss','CO',69.8960105200,71.8204765000), (706,'Little Rock','AR',122.2368191000,121.1527177000), (709,'Nubieber','CA',132.9033933000,49.2776120500), (710,'Turners Falls','MA',31.0872626500,125.0944216000), (711,'Turner','AR',50.2438053400,101.4580163000), 
  (712,'Dundee','IA',61.6022030600,105.0400041000), (715,'Hyde Park','MA',65.0914004000,156.2447451000), (716,'Schleswig','IA',119.2539069000,51.8810853800), (718,'Taft','CA',107.8609513000,146.7421276000), (722,'Marion Junction','AL',53.3245729800,31.3369679800), (725,'Alpine','AR',116.8197146000,114.6480471000), (727,'Winslow','IL',113.1328079000,38.7145009600), (728,'Roy','MT',41.3118776100,51.5646792900), 
  (731,'Emmett','ID',57.0955731300,31.5267914500), (733,'Pelahatchie','MS',38.5816159500,28.1195070300), (735,'Wilton','ME',56.5794408300,157.1906205000), (738,'Philipsburg','MT',95.9553186500,72.2444236500), (739,'Fort Meade','FL',43.9865766500,35.2970938400), (740,'Siler','KY',137.0193079000,117.2464806000), (741,'Jemison','AL',62.1030710800,25.7126058100), (743,'De Tour Village','MI',25.4194894800,25.1056543400), 
  (745,'Windom','KS',114.1911261000,126.3861311000), (746,'Orange City','IA',93.5327056100,162.9473363000), (750,'Neon','KY',101.9782171000,147.6742197000), (751,'Agency','MO',59.2775475800,95.6830537600), (752,'East Irvine','CA',106.2316586000,115.2528621000), (753,'Algonac','MI',118.7398038000,80.1467111400), (754,'South Haven','MI',144.6571707000,52.7858177300), (755,'Sturgis','MI',117.3924210000,135.3989883000), 
  (756,'Garden City','AL',96.0790827200,105.4245193000), (757,'Lakeville','CT',59.8686701200,94.9886017400), (766,'Gustine','CA',111.0875596000,140.8338617000), (767,'Pomona Park','FL',100.5211913000,163.3497491000), (774,'Manchester','IA',129.6682154000,123.2967519000), (775,'Eleele','HI',80.9097123600,152.5215045000), (777,'Edgewater','MD',130.0676569000,72.2908071900), (778,'Pine Bluff','AR',60.4100168700,145.7882763000), 
  (779,'Del Mar','CA',59.1787894800,95.7703215000), (780,'Cherry','IL',68.2970846700,46.7038350600), (781,'Hoffman Estates','IL',129.4025483000,53.4212616900), (783,'Strawn','IL',29.6788503800,51.0886499500), (784,'Biggsville','IL',85.9257870100,138.7463469000), (789,'Hopkinsville','KY',27.3187289300,47.9465291900), (791,'Scotts Valley','CA',119.9347043000,90.9520199600), (794,'Kissee Mills','MO',139.6503652000,73.4160988400), 
  (799,'Corriganville','MD',141.3837890000,153.6500914000), (801,'Pocahontas','IL',109.6304686000,83.2310949400), (804,'Fort Lupton','CO',38.5048882800,93.3924749900), (805,'Tamms','IL',59.8676664500,75.0516444700), (811,'Dorrance','KS',102.0888316000,121.5614372000), (813,'Verona','MO',109.6602903000,152.6449499000), (814,'Wickliffe','KY',80.2996573500,46.1299348900), (815,'Pomona','MO',52.3334681800,50.2822250700), 
  (819,'Peaks Island','ME',59.1404627600,110.6921368000), (820,'Chokio','MN',81.3607332600,134.2321130000), (821,'Sanders','AZ',130.5003609000,96.7792568600), (824,'Loma Mar','CA',48.6978857200,130.5393541000), (825,'Addison','MI',96.3695367400,142.4105732000), (826,'Norris','MT',47.1855034200,37.2572735300), (827,'Greenville','IL',50.6372968900,153.0238915000), (829,'Seward','IL',72.4193091700,90.2089020900), 
  (830,'Greenway','AR',119.2726008000,35.9917637100), (833,'Hoskinston','KY',65.7515349000,65.6793726500), (834,'Bayville','ME',106.7349403000,143.4078424000), (836,'Kenner','LA',91.7382538600,126.5686480000), (838,'Strasburg','CO',89.3969009800,47.8944128400), (839,'Slidell','LA',85.3227030400,151.8743276000), (841,'Freeport','MI',113.5505305000,50.9583863400), (842,'Decatur','MI',63.3115408500,161.4235787000), 
  (843,'Talbert','KY',39.8594792100,58.8499976900), (844,'Aguanga','CA',79.8916565700,65.9395925100), (845,'Tina','MO',131.7039678000,28.1181011000), (849,'Harbor Springs','MI',141.3013054000,148.8592992000), (851,'Gatewood','MO',76.3156273300,145.6683330000), (853,'Coldwater','KS',47.5061751700,26.3100264500), (854,'Kirkland','AZ',86.4100423100,57.9952384300), (861,'Peabody','KS',75.4161481600,152.2100746000), 
  (866,'Haverhill','IA',61.8324671800,109.1656568000), (867,'Beaver Island','MI',81.8844776900,164.8760477000), (868,'Sherrill','AR',79.9644072700,152.2197289000), (871,'Clarkston','MI',93.9409251100,80.5382687600), (878,'Rantoul','KS',31.8049293500,118.6160845000), (884,'Southport','CT',59.0933623800,63.1305214400), (885,'Deerfield','MO',40.2136640000,35.9386994000), (886,'Pony','MT',99.2583129200,162.8777336000), 
  (888,'Bono','AR',133.2763140000,150.4963257000), (889,'Lena','LA',78.1551087400,129.6204891000), (890,'Eufaula','AL',140.2958283000,103.0868213000), (891,'Humeston','IA',74.5122239400,122.4246326000), (892,'Effingham','KS',132.9495023000,97.7174766400), (896,'Yazoo City','MS',95.0089627100,85.2246503700), (897,'Samantha','AL',75.2235845000,35.9447919200), (899,'Fremont','MI',54.4713215300,150.8233711000), 
  (901,'Manchester','MN',71.0209801200,84.0075292200), (904,'Ermine','KY',119.6401426000,62.7981262700), (905,'Newark','IL',72.5304149100,129.8890512000), (906,'Hayfork','CA',35.2971959000,116.6698147000), (907,'Veedersburg','IN',78.8963919700,94.8547536400), (908,'Bullhead City','AZ',94.8299688100,30.4295775500), (909,'Carlock','IL',117.3209611000,84.8024465900), (910,'Salem','KY',86.9752472400,113.9609797000), 
  (914,'Hanscom Afb','MA',129.1866507000,136.4061533000), (919,'Knob Lick','KY',135.8510619000,33.3900339100), (920,'Eustis','FL',42.7363096400,39.4833609100), (921,'Lee Center','IL',95.7911378400,77.1305915700), (922,'Kell','IL',70.3582986100,58.7442278300), (923,'Union Star','MO',79.0719327200,132.6554698000), (927,'Quinter','KS',59.5825700400,25.3613215200), (928,'Coaling','AL',144.2558559000,52.2061892500), 
  (938,'Andersonville','GA',141.3126586000,72.5317868600), (940,'Paron','AR',59.1383428700,104.3412062000), (941,'Allerton','IA',61.8414944900,112.5029954000), (944,'Ledyard','CT',134.5468125000,143.8149657000), (946,'Newton Center','MA',48.4069779100,144.8418196000), (948,'Lupton','MI',139.9255926000,53.3639718100), (949,'Norway','ME',83.8913049300,88.4074677300), (950,'Peachtree City','GA',80.4921245000,155.9823395000), 
  (953,'Udall','KS',112.6844799000,59.9586338800), (955,'Netawaka','KS',109.2057274000,119.7404946000), (957,'South El Monte','CA',74.0495834600,79.6438173200), (959,'Waipahu','HI',106.4460526000,33.9145179200), (960,'Deep River','IA',75.3728161700,38.5668881400), (963,'Eriline','KY',93.6174794700,65.4390210400), (965,'Griffin','GA',38.7414690400,151.7182093000), (968,'Norris City','IL',53.6724568500,76.1050462500), 
  (969,'Dixie','GA',27.2171379100,36.4737889900), (970,'East Haddam','CT',115.6833374000,132.3781409000), (971,'Graettinger','IA',94.6628366500,150.3826243000), (973,'Andover','CT',51.7401850100,52.5323036900), (975,'Panther Burn','MS',116.5112680000,164.5153249000), (977,'Odin','IL',53.4885877300,115.7934363000), (981,'Lakota','IA',56.1541367500,92.3861256900), (982,'Holbrook','AZ',134.8838521000,103.8569792000), 
  (983,'Patriot','IN',82.6379508400,46.0835493200), (985,'Winslow','AR',126.1369390000,126.1174067000), (987,'Hartland','MI',136.2638918000,107.7380670000), (988,'Mullan','ID',143.2982072000,154.6730256000), (990,'Bison','KS',132.2279842000,74.8929007900), (994,'Kanorado','KS',65.4207842400,85.7224923200), (996,'Keyes','CA',76.9679430400,85.6062989900), (998,'Oakfield','ME',47.6576232100,132.2118817000) 
  --select * from @Station order by 1
  --select distinct cast( PERCENTILE_DISC(0.5) WITHIN GROUP ( ORDER BY lat_n ) OVER ( partition by (select count(*) from @station)) as numeric(32,4)) from @Station
  
  Select cast(S.LAT_N as numeric(32,4)) median from @Station S where ( select Count(Lat_N) from @Station where Lat_N < S.LAT_N ) = ( select count(Lat_N) from @Station where Lat_N > S.LAT_N )
  
  /* Hackerrank accepted solution:
  Select cast(S.LAT_N as numeric(32,4)) median from station S 
  where ( select Count(Lat_N) from station where Lat_N < S.LAT_N ) = ( select count(Lat_N) from station where Lat_N > S.LAT_N )
  Output: 83.8913
  */
  